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
| Parameter | Type | Nullable | Description |
|---|---|---|---|
| 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:
| Key | Default Value |
|---|---|
field | null |
type | null |
condition | null |
stringValue | null |
numberValue | null |
dateValue | null |
minNumberValue | null |
maxNumberValue | null |
minDateValue | null |
maxDateValue | null |
stringListValue | null |
numberListValue | null |
dateListValue | null |
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)