Page tree
Skip to end of metadata
Go to start of metadata

We will now polish up the query by making it more flexible and the result more beautiful. Go back to the PocketQuery administration using the link from the user menu. Go to "Queries" and click the entry in the list on the left to open and edit your query.

In the statement remove the part "Europe" and replace it with :continent. A colon marks a PocketQuery parameter. Each time when adding the macro to a page, the user can set the value for it. The default parameter type is String, which means the value of the parameter will be enclosed by double quotes - which is exactly what we need in this case. Additionally, further specify the SELECT clause to get only the columns that are of interest (Code, Name, Continent, Region and Population).

Save the query, go back to the Confluence page, edit it, click on the PocketQuery Macro and edit it. You can now specify the parameter named "continent" that we just defined in the query and thus change the statement that is executed in the background. Thanks to the shorter SELECT clause the resulting table will have fewer columns and look much leaner.

  • No labels