Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I add a "Table Filter" Macro to a Confluence page using an API?

Antonio Vivaldi
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!
June 11, 2025

I have a Python scripts that periodically updates a Confluence page which includes a table.

I would like to include in the html that updates the page the "Filter Table" macro.

I included the following in the html:

"<p>Macro test</p><p><ac:structured-macro ac:name=\"table-filter\" ac:schema-version=\"1\" /></p>"

and got 200 OK.

However, when I opened the Confluence page, I got:

Oops, it seems that you need to place a table or a macro generating a table within the Table Filter macro.

It seems that I am headed in the right direction, however, I don't know how to proceed.

I would appreciate an example.

Thank you.

 

 

2 answers

3 votes
Aliaksei Mikhailau _Stiltsoft_
Contributor
June 12, 2025

 

Hello @Antonio Vivaldi  ,

Concerning our Table Filter, Charts & Spreadsheets for Confluence app, it appears you have added the macro correctly; however, there is no source table inside our macro to process. Therefore, the corresponding message appears, which is why you will need to add the table itself inside the macro from the markup.

For example:


<table>

<colgroup>

<col/>

<col/>

</colgroup>

<tbody>

<tr>

<th scope="col">T1</th>

<th scope="col">T2</th>

</tr>

<tr> <t

d>1</td>

<td>a</td>

</tr>

<tr>

<td>2</td>

<td>b</td>

</tr>

</tbody>

</table>


Feel free to find out more within the Atlassian documentation, if needed.

0 votes
Antonio Vivaldi
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!
June 12, 2025

Hello Aliaksei,

Thank you very much for helping me here.

What I actually needed, and sorry for not being clear enough about my needs, was this.
I figured it out late last night:

html_page = f'''<h2>Hello {TeamName}</h2>
<ac:structured-macro ac:name="table-filter" ac:schema-version="1" data-layout="default">
<ac:parameter ac:name="userfilter">Account ID,Account Name</ac:parameter>
<ac:rich-text-body>
{TABLE}
</ac:rich-text-body>
</ac:structured-macro>
'''

(Python)

I had the TABLE part, what I needed was the syntax of the table-filter and how to integrate the table html data into it.

Thanks Again!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events