I recently went to Atlassian’s App Week in Berlin. Here’s some findings on Table Extensibility in Confluence.
Table Extensibility – What is it?
- Sneak Peak at Referentiality within Confluence – available and natively working now in Confluence Cloud
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 thantable-json
- Developer Preview of Referentiality within Confluence Released! suggests you can use either
- 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 😞
- Update the the
- Ensure that any empty table cells have something like a
in them, otherwiseAP.dataProvider.emitToDataProvider
will silently crap out.
With thanks to…
- GT Deng (Atlassian)