Description
The relation
function returns the value of a relation flavor. The index
parameter can be used to return a specific element. If omitted, the function always returns the first element. If index
is set to -1, all elements are returned as a comma-separated list.
Note: This function cannot be persisted using persist
.
Syntax
relation(name[, index])
Arguments
Argument | Description |
---|---|
name | The name of the relation flavor whose value should be retrieved. |
index (optional) | The position of the desired element in the relation. 0 returns the first element, -1 returns all elements as a comma-separated list. If omitted, the function returns the first element by default. |
Return Types
The function returns the value of the specified relation flavor. This can be a single element or a comma-separated list, depending on the value of the index
parameter.
Examples
Formula | Result |
---|---|
relation("Team Members") |
Returns the first team member in the relation. |
relation("Team Members", 1) |
Returns the second team member in the relation. |
relation("Team Members", -1) |
Returns all team members as a comma-separated list. |
Notes
- If the
index
parameter has an invalid value (e.g., greater than the number of elements), the function may return an error or an empty result. - The function does not support persistence and cannot be used outside the current context.
- The function can be used at both the project and task level, depending on the relation flavor.
Comments
0 comments
Please sign in to leave a comment.