Skip to main content

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
The root node configured for the Jobs interface with sorting

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.

Choosing the All node from the list
An All node on the query branch

3 Add the first comparison

Select Add node and choose Greater than. The query splits into two branches.

Choosing the Greater than node from the list
The query branching at the All node

4 Read the Raised Time attribute

Select the left segment and choose Attribute.

Choosing the Attribute node type

Select to open the Pathfinder and choose Raised Time.

Selecting the Raised Time attribute in the Pathfinder
The Raised Time attribute filling the left segment

5 Set the start date

Select the right segment and choose Date Time. It defaults to today.

The Date Time node defaulting to today

Select the date to open the calendar picker and change it to 15 March 2026.

Setting the date in the calendar picker

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.

An All node with two conditions comparing the Raised Time attribute to 15 March 2026 and 30 April 2026
info

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"]
}
}
]
}
]
}
]
}