Logical nodes
Combine multiple conditions
Logical nodes let you combine multiple comparison nodes by splitting the query into multiple branches. You can also chain logical nodes together to build more complex queries.
There are two types:
-
All - items must satisfy every branch.
-
Any - items must satisfy at least one branch.
Usage
Logical nodes are conditions, so you can add them directly after the root node or another logical node.
Always add a logical node first! This gives you flexibility to add more conditions later, without rebuilding the query.
Options
Select a logical node to access its options:
-
Swap - use a different logical node.
-
Delete - remove the node and everything after it.
Examples
All
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.
To build this step-by-step, see Example 3 - Logical branches.
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"]
}
}
]
}
]
}
]
}
All + Any
Fetch all defects remedied after 2 July 2024 that have related inspections or jobs.
In AQS terms:
Fetch items of the Defects interface where their Remedied Date attribute is greater than 2 July 2024, AND where either their Defect Inspections attribute is set OR their Raised Jobs attribute is set.
See JSON code
This code may reference designs, interfaces, attributes or items that don't exist in your company project.
{
"type": "Query",
"properties": {
"collectionCode": "Live",
"dodiCode": "designInterfaces_defects"
},
"children": [
{
"type": "And",
"children": [
{
"type": "GreaterThan",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_defectsRemediedDate"
}
},
{
"type": "DateTime",
"properties": {
"value": ["2024-07-02T00:00:00.000Z"]
}
}
]
},
{
"type": "Or",
"children": [
{
"type": "Exists",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_defectsWithInspectionsDefectInspection"
}
}
]
},
{
"type": "Exists",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_defectsRaisingJobsRaisedJobs"
}
}
]
}
]
}
]
}
]
}