get (Read value from data field)
The $get function is used to read a data field value from a specific object. The data field can be specified as a data field path (see parameter list).
Syntax
$get(host,dataField)
Parameter
Name |
Description |
host |
The object from which the data field path is to be evaluated. |
dataField |
The path to a data field. |
Return value
Returns the value that was read from the specified data field or null if the data field does not exist or is empty.
Example
The following object is given, which is transferred to the calculation function:
{
"person"
: {
"name"
:
"Robert Weber"
,
"age"
:
"32"
,
"tasks"
: [
"IT Leiter"
,
"3rd Level Support"
,
"Software Customizing"
]
}
}
The object shown above is transferred to the calculation expression as an input object ($input). As a result of the expression, both the name of the person and their primary task (first element of tasks) should be returned.
$get($input,person.name) - $get($input,person.tasks.0)
The result of the example for the object shown above is: 'Robert Weber – IT Manager'.