Skip to main content

Example 1 - Check an attribute

Compare an attribute to a fixed value

This example demonstrates how to build the following query in the AQS Builder:

Fetch all defects that are awaiting inspection.

In AQS terms:

Fetch items of the Defects interface where their Status attribute equals Awaiting Inspection.

1 Configure the root node

Select the root node and set:

  • AQS type - AQS Query
  • Design or interface - Defects
  • Collection - Live
  • Attributes - Title, Subtitle, Status
The root node configured for the Defects interface

2 Add the comparison

Select Add node and choose Equals.

Choosing the Equals node from the list
An empty Equals node on the query branch

3 Read the Status attribute

Select the left segment and choose Attribute. It defaults to the first suitable attribute on the design/interface being queried.

Choosing the Attribute node type
The Attribute node filling the left segment

Select to open the Pathfinder. As Status is a Link attribute, select its arrow and then Select this.

Following the Status link attribute in the Pathfinder
The Status attribute selected

4 Choose the status to match

Select the right segment, choose Item, then Choose your Items.

Choosing the Item node type

Choose Awaiting Inspection from the list of Defect Statuses items.

Selecting the Awaiting Inspection status item
info

You can select more than one Defect Statuses item. The query will fetch any Defects item with any of your selected statuses.

5 Finish

Select Done (bottom-left) to finish.

An Equals node comparing the Status attribute to Awaiting Inspection
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_defectsStatus"],
"collectionCode": "Live",
"dodiCode": "designInterfaces_defects"
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_defectsStatus"
}
},
{
"type": "AlloyId",
"properties": {
"value": ["5c8bdfb58ae862230019dc1f"]
}
}
]
}
]
}