Is it possible to have rows added to a table under different conditions?

Joli November 7, 2024

Is it possible to have rows added to a table under different conditions? For example, if I have a table with 4 rows, and under some circumstances I want the same table to have 6 rows. Depending on, say the variant I've applied to the page?

I know that I can add a separate table with conditional content but that kinda messes up the formating with a new table header and a space between the two tables. I want it to be seamless and dynamic in the same table depending on the variant I export.

1 answer

1 accepted

2 votes
Answer accepted
Humashankar VJ
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.
November 10, 2024

Hi @Joli 

With the Table Filter and Charts for Confluence app from the Atlassian. Next, create your initial table on the Confluence page. Then, edit the page and add the Table Transformer macro.

  • To conditionally add rows, write an SQL query within the macro. For example: "SELECT * FROM T WHERE condition = 'value'". Replace "T" with your table name and "condition = 'value'" with your specific condition.

Finally, configure the macro to apply your SQL query to the table. This will dynamically update your table based on the specified conditions.

Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards

Joli November 10, 2024

This is very good to know, I will look into using it. Thank you!

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.
November 11, 2024

Hi @Joli ,

The mentioned Table Filter, Charts & Spreadsheets for Confluence app is ours and for the described case seems that the Table Filter macro will suit you better.

As I understand, you are talking about the Scroll app from another vendor where you can choose the page version and see different content depending on it. The Conditional Content macro can really suit your needs but the issue is that for Version 1 you should have Table 1 with 4 rows and for Version 2 you should have Table 2 with 6 rows. It will look good on the page in view mode but while editing you'll need to update both of these tables.

So, you may insert the Table 2 where you have all the rows, wrap it in our Table Filter macro and set filters on the filtration panel: required column names and blank fields for users to type in their values. So, the table will be filtered on the fly in the view mode and each user will see precise data.

If you are not sure how the app works and what use cases are covered by our macros, please book a call with the team - we'll be able to show you everything live.

Like # people like this
Joli December 3, 2024

Yes, sorry that I forgot to mention I was using the Scroll macro. Is it possible when exporting to, say, a PDF or HTML Export to have the rows dynamically change based on what variant I chose? Or does it only work inside confluence in view mode?

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.
December 4, 2024

The table within the Table Filter macro will be the same for all the versions, you'll just get a filtration panel above where you can set filters and save them if required (or filter anything on the fly and leave the table as it is).

These filters are not connected to the page versions, you should use the Conditional Content macro instead. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events