Search ProcessMaker Data Using ProcessMaker Query Language (PMQL)

Use PMQL to search through Requests, Tasks, and Collection records in your ProcessMaker organization.

Overview

ProcessMaker Query Language (PMQL) is a custom ProcessMaker language to search through ProcessMaker data in your organization. Similar in ways to SQL, which is a standard language for storing, manipulating and retrieving data in databases, use PMQL to find Requests, Tasks, and ProcessMaker Collection record information. PMQL uses both common SQL syntax as well as custom syntax parameters to find ProcessMaker data.

Use PMQL in the following ways:

PMQL is customized with particular syntax parameters to find ProcessMaker data unique to each of these ProcessMaker data. See the following sections regarding how to use PMQL:

PMQL Syntax for Requests

Use standard SQL syntax that ProcessMaker Query Language (PMQL) supports in conjunction with the following PMQL parameters to perform advanced Request searches.

Processes Associated with the Request

Use the following syntax as a guide to include one Process in your search criteria:

(request = "exact Process name including spaces")

Use the following syntax as a guide to include two or more Processes in your search criteria:

(request = "Process name 1" OR request = "Process name 2")

Request Information

Use the following syntax as a guide to reference Request-related information in your search criteria.

data.RequestData

data. represents that what follows derives from Request information, as is used in JSON dot notation. To derive that Request information, view the Data tab in the summary for a completed Request to view the data from a completed Request, and then use the specific key name (represented in red-colored text) in place of RequestData in this syntax. Spaces are allowed between operators. Example: data.last_name = "Canera". Note that your ProcessMaker user account or group membership must have the Requests: Edit Request Data permission. Ask your ProcessMaker Administrator if you do not see the Data tab in completed Requests.

ProcessMaker Magic Variables

Following the same syntax as referencing Request-related information, reference ProcessMaker Magic Variables in your search criteria. See Magic Variable Descriptions.

Request Status

Use the following syntax as a guide to include one Request status in your search criteria:

(status = "In Progress")

Use the following syntax as a guide to include two or more Request statuses in your search criteria:

(status = "Completed" OR status = "Canceled")

Requesters

Use the following syntax as a guide to include one requester in your search criteria:

(requester = "Username1")

Use the following syntax as a guide to include two or more requesters in your search criteria:

(requester = "Username1" OR requester = "Username2")

Request Participants

Use the following syntax as a guide to include one Request participant in your search criteria:

(participant = "Username3")

Use the following syntax as a guide to include two or more Request participants in your search criteria:

(participant = "Username3" OR participant = "Username4")

Request Age

Use the following syntax as a guide to include the age of a Request or Task in your search criteria:

updated_at < NOW -2 day

Use updated_at < NOW to represent how old the sought after Request or Task is, then use - followed by an integer to specify that time. The units of time second, minute, hour and day are supported.

PMQL Syntax for Tasks

Use standard SQL syntax that ProcessMaker Query Language (PMQL) supports in conjunction with the following PMQL parameters to perform advanced Task searches.

Processes Associated with the Task's Request

See Processes Associated with the Request.

Request Information

See Request Information.

ProcessMaker Magic Variables

See ProcessMaker Magic Variables.

Task Name

Use the following syntax as a guide to include one Task name in your search criteria:

(task = "exact Task name including spaces")

Use the following syntax as a guide to include two or more Task names in your search criteria:

(task = "Task name 1" OR task = "Task name 2")

Task Status

Use the following syntax as a guide to include one Task status in your search criteria:

(status = "In Progress")

Use the following syntax as a guide to include two or more Task statuses in your search criteria:

(status = "In Progress" OR status = "Completed")

Task Age

See Request Age.

Task Due

Use the following syntax as a guide to include when a Task is due in your search criteria:

due < NOW -2 day

Use due < NOW to represent when a Task is due, then use - followed by an integer to specify that time. The units of time second, minute, hour and day are supported.

PMQL Syntax for ProcessMaker Collections

ProcessMaker Package Required

To search records in a ProcessMaker Collection, the Collections package must be installed in your ProcessMaker instance. The Collections package is not available in the ProcessMaker open-source edition. Contact ProcessMaker Sales or ask your ProcessMaker sales representative how the Collections package can be installed in your ProcessMaker instance.

Use standard SQL syntax that ProcessMaker Query Language (PMQL) supports in conjunction with the following PMQL parameters to search records in a ProcessMaker Collection.

Record ID

Use the following syntax as a guide to include one record in your search criteria based on its ID (as noted in the # column when viewing the Collection's records):

id = 4

Use the following syntax to include all records in your search criteria since record IDs begin with 1:

id > 0

Record Information

Use the following syntax as a guide to reference record-related information in your search criteria.

data.RecordData

data. represents that what follows derives from record information, as is used in JSON dot notation. Record data is derived from the Variable Name setting values in the ProcessMaker Screens that are used to create, edit and view records in this Collection. Use these Variable Name setting values in place of RecordData in this syntax. Spaces are allowed between operators. Example: data.last_name = "Canera". Note that your ProcessMaker user account or group membership must have the appropriate permissions to view and edit ProcessMaker Screens to view Variable Name setting values. Ask your ProcessMaker Administrator if you do not have the appropriate permissions.

Record Age

Use the following syntax as a guide to include a period of time in your search criteria:

updated_at < NOW -2 day

Use updated_at < NOW to represent how much time from the present the sought after record is, then use - followed by an integer to specify that time. The units of time second, minute, hour and day are supported.

Standard SQL Syntax PMQL Supports

ProcessMaker Query Language (PMQL) supports the following standard SQL syntax:

Operators

PMQL supports the following operators in and between search criterion:

  • Equal to: =

  • Not equal to: !=

  • Less than: <

  • Greater than: >

  • Less than or equal to: <=

  • Greater than or equal to: >=

  • Use AND operators between each set of search criterion to search using multiple criteria.

  • Use the AND operator between criterion to search for multiple specified criterion.

  • Use the OR operator between criterion to search for either specified criterion.

Spaces are allowed between operators. Example: data.last_name = "Canera".

Wildcard Syntax

Use % as a wildcard character to substitute one or more characters in any PMQL-supported parameter that uses a string. Include the % character within the quotation marks (") of the parameter. Examples:

  • request = "P%" finds Requests associated with all Processes that begin with P

  • status = "c%" finds Requests with both Completed and Canceled statuses

  • data.last_name = "C%" finds all values that begin with C in the last_name key name

  • task = "T%" finds all Tasks that begin with T

Related Topics