Skip to main content
Skip table of contents

Query Parameters

PocketQuery allows you to add parameters to your Query Statement. This can be done via the :parameter-syntax. Users can later define values for parameters in the PocketQuery Macro.

JDBC / SQL

Here is an example of a SQL statement with a Query Parameter:

CODE
SELECT author_id, name
FROM author
WHERE author_id > :min_author_id

Here we have a single parameter called min_author_id. Notice how we expect it to be of type Integer as we are using the > operator on it. For this reason, you will need to set the type of this parameter to Integer under the Parameters tab in your Query:

Parameter Types in PocketQuery Interface

If you want to see an example of how this works, please refer to this part of our Getting Started Guide.

REST

An example REST path with a Query Parameter could look like this:

CODE
/countries/:region?limit=:max_results

Here we have two parameters:

  • region

  • max_results

In contrast to JDBC/SQL Queries, these values do not need a type. They will always be URL-encoded and replaced.

XML responses

PocketQuery can also understand XML responses coming from REST Datasources. If PocketQuery receives XML it will try to automatically convert it into JSON before processing it further. Enable the debug mode of your macro to see details about the transformation.

Date Type Parameter

When a parameter is set to Date, a date picker will appear in both the Macro Editor and in editable parameters for users. This makes it easier to select and input dates when running a Query:

Bildschirmfoto 2025-12-05 um 15.44.17.png

Bildschirmfoto 2025-12-05 um 15.45.05.png

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.