I recently went to Atlassian’s App Week in Berlin. Here’s some findings on Table Extensibility in Confluence.

Table Extensibility – What is it?

Soon available for:

  • ✅ Atlassian Connect dynamic content macros
  • ❌ Forge – no, not yet

How to emit data from your macro

Update your macro definition in atlassian-connect.json with refDataSchema like so:

"refDataSchema": {
  "outputType": "table-adf"
},

Whenever you need to update the emitted data, do this:

AP.dataProvider.emitToDataProvider({
  eventData: {
    "table-adf": tableAdf,
  },
});

Where tableAdf is a table in ADF (JSON) format.

🚀 Demo

🤷 Gotchas

  • Use table-adf rather than table-json
  • Sometimes, but rarely (e.g. after a hard reload) AP.dataProvider doesn’t get loaded before your Connect macro, so test it’s there before emitting the event data.
    AP.dataProvider && AP.dataProvider.emitToDataProvider(...);
    
  • The data provider was not accepted. My macro was not emitting any data:

    Fix:

    • Update the the refDataSchema in the macro descriptor to:
      "refDataSchema": {
        "inputType": "table-adf",
        "outputType": "table-adf"
      }, 
      

    I really don’t get why this may be required, likely a bug – it also adds clutter to the macro menus 😞

  • Ensure that any empty table cells have something like a   in them, otherwise AP.dataProvider.emitToDataProvider will silently crap out.

With thanks to…

  • GT Deng (Atlassian)