Read attribute
Syntax
$object.get(`$attr-literal`)
$object.get($part-expr)
Description
Returns the value of the specified attribute from the object. The attribute can either be specified by an attribute literal (the normal case), or calculated dynamically by an expression.
In a secured evaluation only objects the current user may discover are delivered.
Parameters
| Name | Type | Description | Mandatory | Default |
|---|---|---|---|---|
| object | Business object | An object whose attribute is to be determined. | yes | |
| attr-literal | String | Attribute literal representing the attribute being searched for. | One of the two is required. | |
| part-expr | Number/string/boolean/business object/set/function | Dynamically calculated attribute. |
Return value
Type: Number/string/boolean/business object, set
The value of the attribute of the given object.
Examples
Single read of an attribute
{
element = new(`my.module:MyType`);
$element.set(`my.module:MyType#myAttr`, "test");
$element.get(`my.module:MyType#myAttr`);
}
Output: test
Searching for specific objects
all(`my.module:MyType`).filter(element -> $element.get(`my.module:MyType#myAttr`).isStringEqual("test"))
Output: Objects with the attribute value test for myAttr.