Build tables from master list
Asked by Kate Grzegorczyk:

I need to construct several tables on various pages that would always have the same first column with the same exact list. So I'm looking for some way of being able to create a table from a master list. Each master list entry would result in a row created, then I can add custom columns for each table. So if my master list had the following data: red, blue, orange:

Table 1:

COLOR \| MONTH \| YEAR \|

red \| Aug \| 2011 \|

blue \| Jan \| 2014 \|

orange \| Oct \| 2009 \|

Table 2:

COLOR \| USER \| USED \|

red \| admin \| yes \|

blue \| editor \| no \|

orange \| admin \| n/a \|

To add to the fun, sometimes I need the custom columns to pull in the entry from a data snippet on a different pages. Eg. USED yes/no/na would be contained somewhere else in a table on a different page. Is any of this possible?


Answers:
author: Natalie Paramonova [Stiltsoft]
body: Hi Kate,

You can try the [Table Filter and Charts](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?hosting=server&tab=overview) app to resolve your issue.

You can use the [Table Excerpt Include](https://docs.stiltsoft.com/display/TableFilter/How+to+use+Table+Excerpt+and+Table+Excerpt+Include+macros?src=contextnavpagetreemode) macro for multi-excerpt from any pages (child pages, specific pages, pages by labels, current page). Then you can use the [Table Transformer](https://docs.stiltsoft.com/display/TableFilter/How+to+use+Table+Transformer+macro?src=contextnavpagetreemode) macro to merge all the tables using the [default presets](https://docs.stiltsoft.com/display/TableFilter/Default+automatic+presets?src=contextnavpagetreemode) or [custom SQL queries](https://docs.stiltsoft.com/display/TableFilter/Custom+Transformation+-+use+cases+with+advanced+SQL+queries?src=contextnavpagetreemode).

The steps may be as follows:

1. Create a page and add the table with the master list. Wrap the table with the Table Excerpt macro.

![2019-04-08_12h38_32.png](https://community.atlassian.com/t5/image/serverpage/image-id/50800iE9C76151AA9D790A/image-dimensions/230x226?v=v2 "2019-04-08_12h38_32.png")

2. Excerpt the master list with the help of the Table Excerpt Include macro on any page.

![2019-04-08_12h37_45.png](https://community.atlassian.com/t5/image/serverpage/image-id/50801i9EDC5A248BBFC335/image-dimensions/543x336?v=v2 "2019-04-08_12h37_45.png")

3. Add the table with the custom columns, place the Table Excerpt Include macro and the table with the custom columns in the Table Transformer macro body.

![2019-04-08_13h43_39.png](https://community.atlassian.com/t5/image/serverpage/image-id/50803i232C3229BCF11B64/image-dimensions/343x258?v=v2 "2019-04-08_13h43_39.png")

5. Use the Lookup tables preset to merge tables by the Color column.

![2019-04-08_12h39_41.png](https://community.atlassian.com/t5/image/serverpage/image-id/50799iA0EA5F47DD1549FC/image-dimensions/553x323?v=v2 "2019-04-08_12h39_41.png")

![2019-04-08_12h42_11.png](https://community.atlassian.com/t5/image/serverpage/image-id/50798iF54DC171BCFB52B7/image-dimensions/553x323?v=v2 "2019-04-08_12h42_11.png")

6. If you need to add the data from the separated page, use the Table Excerpt and Table Excerpt Include macros as well and merge these tables using the Table Transformer macro.

![2019-04-08_12h43_41.png](https://community.atlassian.com/t5/image/serverpage/image-id/50796i2FF8D14B65D0467A/image-dimensions/283x233?v=v2 "2019-04-08_12h43_41.png")

![2019-04-08_13h44_01.png](https://community.atlassian.com/t5/image/serverpage/image-id/50802iA95AE82B3F2EC440/image-dimensions/354x266?v=v2 "2019-04-08_13h44_01.png")

![2019-04-08_13h28_32.png](https://community.atlassian.com/t5/image/serverpage/image-id/50797i111AA1EDC81CA60F/image-dimensions/467x275?v=v2 "2019-04-08_13h28_32.png")

Please let me know if you have any questions.

The macros are available in Confluence Server and Data Center for now.


Tags: developer

macro

report