I am trying to create a pivot table on a confluence page through the REST API. Basicly I have to peridically update a page on my confluence space with some data oganized as a table. Currently I can update these contents as an html table and later manually wrap the table with the pivot table macro to create the pivot table display on the page, but I would like to do everything automatically from a script by generating the proper XHTML code so that I can update the page by passing this code as the body contents of a REST API content update call.
If you are talking about our Table Filter, Charts & Spreadsheets for Confluence app and its Pivot Table macro, you may insert the macro manually (as you do it now), adjust all the settings in a proper way, and then go check the page storage. There you will see not only your current table but all the macros that are used on the page (and the Pivot Table macro as well). You may save everything to your code and change only the part where the table is placed. Then when the page is restored, you'll see all the macros with an updated table.
Since you mentioned a REST API, I suspect you have a certain level of development expertise.
If tasked with this, I would use Pandas to generate the dataframe and pivot, then export the pivoted dataframe as HTML.
ref:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.