Skip to main content
Version: V2 (Ignition 8.1)

system.mes.query.newFilterRequest

Description​

Generates an empty Filter Request object to provide the structure required by the API to filter query data. A Filter Request is used as a part of a Query Request to filter records retrieved when calling a find method. It is analogous to the WHERE clause in an SQL query.

See the Filter Request Guide for more information on how to use Filter Requests.

Permissions​

This method does not require any permissions.

Syntax​

system.mes.query.newFilterRequest()

Parameters​

ParameterTypeNullableDescription
None--This method does not take any parameters.

Returns​

Returns a JSON representation of the newly created filter request object. The following is a list of keys and default values:

KeyDefault Value
fieldnull
typenull
conditionnull
stringValuenull
numberValuenull
dateValuenull
minNumberValuenull
maxNumberValuenull
minDateValuenull
maxDateValuenull
stringListValuenull
numberListValuenull
dateListValuenull

Code Examples​

# Generate the object structure for a new filter request object with no initial arguments
newFilterRequest = system.mes.query.newFilterRequest()

# Set basic attributes for the new filter request
newFilterRequest["field"] = "createdDate"
newFilterRequest["condition"] = "between"
newFilterRequest["minDateValue"] = "2025-01-01T00:00:00Z"
newFilterRequest["maxDateValue"] = "2026-01-01T00:00:00Z"
# (You can continue setting other properties as needed here)

# Use the filter request in a query
queryRequest = system.mes.query.newQueryRequest()
queryRequest["filters"] = [newFilterRequest]
result = system.mes.material.findMaterials(**queryRequest)

# Output the JSON representation of the result
print(result)