AQS Join node
Description
Like AQS Query, the AQS Join root node fetches items of a single design/interface and their attribute data.
However, if the queried items have a Link attribute that references other items, the query can fetch attribute data for those linked items too!
For example, say you're querying Street Lights items for defects. Each queried item has a Defects attribute, which may link to one or more Defects items. Therefore, your query can fetch attribute data for the Defects items alongside the Street Lights data.
Taking the example further, each linked Defects item has a Status attribute that links to a Default Status item. Therefore, your query can also fetch attribute data for the Default Status items alongside the Defects and Street Lights data.
Usage
All queries start with a root node. Its icon matches the design/interface being queried.
To filter the items fetched by the root node, select to add one or more child nodes.
Configuration
Select the node to set the following properties:
-
AQS type - change to a different root node type.
-
Design or interface - items from this design/interface will be queried.
-
Collection - items from these collections will be queried. By default, only Live is selected.
-
Sort order - choose to sort in Ascending or Descending order.
-
Sort attribute - if set, items will be sorted according to the chosen attribute.
-
Sort item property - if set, items will be sorted according to the chosen property.
-
Attributes - select the item attributes that you want to see data for.
The more attributes you select, the more data is returned. Therefore, for optimal performance, only include attributes that are meaningful to your query.
Example
Fetch all inspections assigned to a particular team
In full detail:
Fetch items of the Inspections interface with a Link attribute that references a Teams item, which has a Team Name attribute equal to some text
To see this example built step-by-step, see Example 4 - Parameter and AQS Join.
See JSON code
This code may reference designs, interfaces, attributes or items that don't exist in your Alloy database.
{
"type": "Join",
"properties": {
"attributes": ["attributes_itemsTitle", "attributes_itemsSubtitle"],
"collectionCode": "Live",
"dodiCode": "designInterfaces_inspections",
"joinAttributes": ["root.attributes_tasksTeam.attributes_teamsTeamName"],
"parameters": [
{
"name": "TeamName",
"type": "String"
}
]
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_teamsTeamName",
"path": "root.attributes_tasksTeam"
}
},
{
"type": "String",
"properties": {
"parameterName": "TeamName"
}
}
]
}
]
}