Example 3 - Logical branches
Combine conditions to test a range
This example demonstrates how to build the following query in the AQS Builder:
Fetch all jobs created between 15 March 2026 and 30 April 2026, sorted by priority.
In AQS terms:
Fetch items of the Jobs interface where their Raised Time attribute is greater than 15 March 2026 AND less than 30 April 2026, sorted by their Priority attribute in Descending order.
1 Configure the root node
Select the root node and set:
- AQS Type - AQS Query
- Design or interface - Jobs
- Collection - Live
- Sorting - Descending
- Sort attribute - Priority
- Attributes - Title, Subtitle, Raised Time, Priority
2 Add the logical node
A date range is two conditions at once. Select Add node and choose All to hold them both, so items must pass every condition.
3 Add the first comparison
Select Add node and choose Greater than. The query splits into two branches.
4 Read the Raised Time attribute
Select the left segment and choose Attribute.
Select to open the Pathfinder and choose Raised Time.
5 Set the start date
Select the right segment and choose Date Time. It defaults to today.
Select the date to open the calendar picker and change it to 15 March 2026.
6 Add the second comparison
Repeat steps 3 to 5 on the other branch, this time using Less than and 30 April 2026.
7 Finish
Select Done (bottom-left) to finish.
You can attach any number of comparison nodes to a logical node, and nest logical nodes inside each other. See Logical nodes.
See JSON code
This code may reference designs, interfaces, attributes or items that don't exist in your company project.
{
"type": "Query",
"properties": {
"attributes": ["attributes_itemsTitle", "attributes_itemsSubtitle", "attributes_tasksRaisedTime", "attributes_tasksPriority"],
"collectionCode": "Live",
"dodiCode": "designInterfaces_jobs",
"sortInfo": {
"attributeCode": "attributes_tasksPriority",
"sortOrder": "Descending"
}
},
"children": [
{
"type": "And",
"children": [
{
"type": "GreaterThan",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_tasksRaisedTime"
}
},
{
"type": "DateTime",
"properties": {
"value": ["2026-03-15T00:00:00.000Z"]
}
}
]
},
{
"type": "LessThan",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_tasksRaisedTime"
}
},
{
"type": "DateTime",
"properties": {
"value": ["2026-04-29T23:00:00.000Z"]
}
}
]
}
]
}
]
}