Skip to main content

system.mes.query.newFilterRequest

Generates an empty non-persisted 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.

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
new_filter_request = system.mes.query.newFilterRequest()

# Set basic attributes for the new filter request
new_filter_request["field"] = "createdDate"
new_filter_request["condition"] = "between"
new_filter_request["minDateValue"] = "2025-01-01T00:00:00Z"
new_filter_request["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"] = [new_filter_request]
result = system.mes.material.findMaterials(**queryRequest)

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