Selectors define what information to retrieve from a context variable. They act as a bridge between the source object (such as {currentObject}) and the actual data you want to use in your expression.
There are two types of selectors:
- Reference selectors
- Reference selectors specify a related object or user.
- As they only point to a related object, they must be followed by a value selector.
- Example:
{currentObject}.parent().name()= Retrieves the name of the immediate parent object of the current object.
- Value selectors
- Value selectors return a specific property or value of the context variable, such as its name, ID, or link.
- They can be used directly in your output or combined with functions for additional formatting.
- Example:
{currentObject}.name()= Retrieves the name of the current object.
Reference selectors
Reference selectors return a reference to an object or a user.
Reference selectors only return an object reference, which is why they must be followed by another selector to retrieve a concrete value.
E.g., {currentObject}.parent(n).name()
| Expression | Description | Supported context variables |
|---|---|---|
.parent(n) | Identifies the parent object that is a specified number (n) of levels above the object. To reference the immediate parent, use .parent() as a shortcut for .parent(1). | Objects |
.relation('string') | Identifies the first object related to the object by the specified relation type (relationTypeKey). | Objects |
.targetObject() | Identifies the target object in a relation. Can be used only with the relation variable ({relation}.targetObject().name()). | {relation} |
.userRelation('string') | Identifies the first user related to the object by the specified user relation type (userRelationTypeKey). | Objects |
These selectors can be further chained with one another, for example:
{currentObject}.parent().relation('core_isMentioned').name()= Returns the name of the object related to the parent.{currentObject}.parent().userRelation('core_steward').email()= Returns the email of the steward of the parent.
Value selectors
Value selectors specify what to retrieve from the source and return a specific value, such as its name, ID, or link.
| Selector | Description | Supported context variables |
|---|---|---|
.attr('string') | Returns the specified attribute value of an object. Interchangeable with .attribute('attributeKey'). | Objects |
.attribute('string') | Returns the specified attribute value (attributeKey) of an object. | Objects |
| .children() | Returns a list of child objects. Can be combined with array functions. | Objects (with children) |
| .children(‘objectTypeKey’) | Returns a list of child objects of the specified object type. Can be combined with array functions. | Objects (with children) |
.email() | Returns the email address of a user. | Users |
.id() | Returns the ID of an object or a user. | Objects / Users |
.link() | Returns a hyperlink to the selected object or user, using the asset’s name as the clickable label.[Object name](....) | Objects / Users |
.link('string') | Returns a hyperlink to the selected object or user, using the provided text as the clickable label.[Text abc](....) | Objects / Users |
.name() | Returns the name of element. | Object / Users / Relations / Workflow |
.pathName() | Returns the path name of an object, which is also the hierarchy_name value in the database. E.g., Parent 1/Object 1. | Objects |
.relations('string') | Returns a list of all target objects in the specified relation type(s). Can be combined with array functions. | Objects |
.text() | Returns the selected comment’s text. | Comments |