Skip to main content

Add node

Description

The Add node takes two numbers as input and adds them together, e.g. 2 + 2 = 4

Usage

The Add node is a function, so it can be added to the segments of comparison nodes and other functions.

alt text

It can be:

Configuration

alt text
  • Swap - change the comparison node. If any segments hold values, they'll remain but the node types offered will be limited.

  • Delete - remove the node.

Example

Fetch all street lights with a column 2 metres taller than this particular one

In full detail:

Fetch items of the Street Lights design where their Column Height attribute is greater than than the Column Height attribute of a particular Street Light item plus 2

alt text
See JSON code
Note

This code may reference a design, item or attribute that isn't present in your Alloy database.

{
"type": "Query",
"properties": {
"collectionCode": "Live",
"dodiCode": "designs_streetLights"
},
"children": [
{
"type": "GreaterThan",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_streetLightsColumnHeight_5e1db714ca31500ad87c5d18"
}
},
{
"type": "Add",
"children": [
{
"type": "ValueFromItemAttribute",
"properties": {
"attributeCode": "attributes_streetLightsColumnHeight_5e1db714ca31500ad87c5d18",
"dodiCode": "designs_streetLights",
"value": ["5d95cc05ca314f0a302da717"]
}
},
{
"type": "Number",
"properties": {
"value": [2]
}
}
]
}
]
}
]
}