How to use SQL for Confluence with Run Self Service Reports for dynamic content
This article explains how to use SQL for Confluence with Run Self Service Reports to display dynamic content on a page.
Instructions
Insert a Run with a user form and parameters macro in a Confluence page and edit the macro to provide field values for the form as shown:
Insert an SQL macro inside the Run macro and write a SELECT statement in the SQL macro settings as shown:
Select CREATOR, CREATIONDATE from SPACES WHERE SPACEID='$Space Id' AND SPACEKEY='$Space Key';Provide the values for the fields and click Run to display the results.
Consider the following sample data and click Run:
The query results are displayed as:
This example is for an SQL Server database. If needed, you can modify the query as per your database, before using it. We recommend testing the query in your database before using it in your production environment.