How to pull data from a table column on one page into a table on a different page

Overview

Assume you have a table that you need to pull content from (if it matches certain criteria) and then place that content into another table on a different page (not a child or parent page). For example, you have a table with a column called 'status'. The status column contains the words green, yellow, or red. If the status is 'red', you'd like to pull the whole row of data that contains the 'red' status and place it into another table. To achieve this follow the steps below.

Prerequisites

  1. Confluence (Server)

  2. SQL-Powered Table Transformer macro for Confluence installed

  3. Documentation: https://v-and-b.atlassian.net/wiki/spaces/PD/pages/763232257  

Step-by-Step Instructions

Put your source table inside the Excerpt macro container.

On your target page add the SQL-Powered Table Transformer macro container.

Then, inside the SQL-Powered Table Transformer macro container, link the source table using the Excerpt Include macro.

Modify the SQL Query in the SQL-Powered Table Transformer macro properties to pull the needed rows from the source table. Its name will be TABLE_1. For example:

SELECT * FROM TABLE_1 WHERE “status” LIKE ‘%red%’

Save the macro.

As a result you should see a new table with all the rows from the source table where status is red.