Skip to main content
Skip table of contents

Basic Functions For Templates

In PocketQuery 4.0 we introduced the concept of query keys for more PQ technical features. Please have a look at PocketQuery 4.x Upgrade Notes if you intend to use this API.

The most basic functions of the templating API can be used to access the result set and retrieve or set its columns and content.


Get the result columns of the given query as JSON serialized string:

JS
/**
 * @param {String} queryKey key of the query
 * @return {String} the columns of the query result as array
 */
PocketQuery.queryColumns(queryKey)

Get the result of the given query as JSON serialized string:

JS
/**
 * @param {String} queryKey key of the query
 * @return {Array} the result of the query as JSON
 */
PocketQuery.queryJson(queryKey)

Get the result of the given query as array.

JS
/**
 * @param {String} queryKey key of the query
 * @return query result as array
 */
PocketQuery.queryArray(queryKey)

JavaScript errors detected

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

If this problem persists, please contact our support.