Inserting a pivot-table macro with REST API

Carlos Borau González
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 12, 2024

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. 

2 answers

2 votes
Stiltsoft support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 12, 2024

Hi @Carlos Borau González ,

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.

0 votes
Jim Knepley - ReleaseTEAM
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
September 12, 2024

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:

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events