@pageTitle variable
Use case
You have a table with page titles. You need to get a dynamic result table where rows correspond to the current page title.
Solution
- Switch the page to the edit mode.
- Insert the Table Transformer macro and paste the table or the macros outputting tables within the macro body.
- Select the macro and click Edit.
- In the Presets tab select Custom transformation and click Next.
Enter the following SQL query:
SQLSave the macro and the page.
The @pageTitle variable can be combined with other variables within the same query and successfully used in more complex SQL queries.
Use case with several variables
You have a table with the list of people (user names) responsible for publishing documentation pages.
You need to do the following:
- Find the logged in (current) Confluence user in the 'Responsible' column and color it in blue (the others will be green)
- Add the current page title (i.e. where the current Confluence user is now) to all the existing page names in the 'Page' table column
Solution
- Switch the page to the edit mode.
- Insert the Table Transformer macro and paste the table or the macros outputting tables within the macro body.
- Select the macro and click Edit.
- In the Presets tab select Custom transformation and click Next.
Enter the following SQL query:
SQLSave the macro and the page.
To learn more about the @currentUser variable, please visit the corresponding page.