Forums

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

Table Transformer - Table merge with conditional column insertion

Brad Johnson
March 24, 2022

Hello All.

I have multiple pages, one for each project each containing two tables of data. I want to merge and transform the data into 1 consolidated table.

Table 1 has basic Project Info in Rows. 1 per project page.

image.png

Table 2 has Project timeline info in rows and columns. 1 per project page.

image.png

What I want is a single table reporting project information, 1 row per project (page) using values from the two tables per project page.

The project info is straight forward (first 5 columns) but I believe I need table transformer to add the timeline columns and populate the cells and that's where I am stuck.

Desired end result

image.png

I've had a bit of a go using examples but I'm not an SQL guy and I haven't seen an example that covers this. Any help would be appreciated.

Thanks in advance.

2 answers

0 votes
Davin Studer
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 Champions.
August 21, 2015

You could wrap the livesearch macro in a user macro that will supply the space key for you. The below user macro gives you all of the livesearch macro parameters except the space key. It will auto insert that one.

Macro Name:
space_livesearch 

Macro Title:
Space Livesearch 

Description:
Embeds a search box into your Confluence page to show search results as you type. 

Macro Body Processing:
No macro body

Template:

## Developed by: Davin Studer
## Date created: 08/21/2015
 
## @param Labels:title=Restrict to label(s)|type=string|required=false|desc=A comma separated list of labels to filter the search by
## @param Size:title=Size|type=enum|enumValues=medium,large|default=medium|desc=
## @param Placeholder:title=Placeholder text|type=string|required=false|desc=
## @param Content:title=Content type to include in search|type=enum|enumValues=all,page,blogpost,comment,spacedesc|default=all|desc=
## @param Additional:title=Additional information|type=enum|enumValues=none,space name,page excerpt|default=space name|desc=
 
<ac:structured-macro ac:name="livesearch">
    <ac:parameter ac:name="additional">$!paramAdditional</ac:parameter>
    <ac:parameter ac:name="placeholder">$!paramPlaceholder</ac:parameter>
    <ac:parameter ac:name="labels">$!paramLabels</ac:parameter>
    <ac:parameter ac:name="spaceKey">
        <ri:space ri:space-key="$content.spaceKey"/>
    </ac:parameter>
    <ac:parameter ac:name="type">$!paramContent</ac:parameter>
    <ac:parameter ac:name="size">$!paramSize</ac:parameter>
</ac:structured-macro>
0 votes
m@
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 20, 2015

I don't think you can have dynamic variables like this in a page template.

There may be another way to do it though (Confluence 5.8+), the search macro that you are using may be able to be replaced with one of the new cql based macros.

The advanced search macro and all the other CQL based search macros all support a "Current Space" filter allowing you to find content in the current space.

Another option will be to consider replacing your page Template with a blueprints which will allow a much richer and more dynamic way to populate the pages.  Look here: https://confluence.atlassian.com/display/DOC/Blueprints

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events