Note: This function is only available on SharpCloud v9.7.0217 and later
Function(s)
GETRELATIONSHIPVALUES(itemIdentifier, codeValue)
GETRELATIONSHIPVALUES(itemIdentifier, codeValue, type)
The GETRELATIONSHIPVALUES is function returns the values stored on relationships connected to the item itself.
Parameters
itemIdentifier – an ARRAY of item names (or Internal ID’s or External ID’s) of the items who’s value you want to return. Name is assumed unless otherwise specified in the type parameter.
codeValue – the code name of the relationship property, attribute or calculated value that you wish to return.
type – an optional TEXT parameter that can change the type of results returned. Valid options are:
- name
- externalid
- internalid
If unspecified or incorrectly entered, ‘name’ is assumed.
Note: The itemIdentifier value, and codeValue can also be passed in an attribute or calculated value. If more than one item with the specified name or External ID exist, results will be unpredictable.
Data Type Returned
Values that are returned can be either an ARRAY OF TEXT, NUMBER, DATE or ARRAY depending on the type of the codeValue.
Examples
In the below examples, the relationships have an attribute with the value called ‘num’.
Add up all the values regardless of direction on each item.
SUM(GETRELATIONSHIPVALUES(RELATEDITEMS(), ‘num’)))
Note: The relationship value will be added to both ends
Add up all values that point TOWARDS the item.
SUM(GETRELATIONSHIPVALUES(RELATEDITEMS(‘ ‘, FALSE, TRUE, FALSE, FALSE) , ‘num’))
Add up all values to items in a specific category, in this case, ‘Projects’.
SUM(GETRELATIONSHIPVALUES(INTERSECT(RELATEDITEMS(), WHERE(category== ‘Projects’)), ‘num’))