The RELATEDITEMS function is a powerful feature which can be used to return a set of items based upon their relationships and their directions. It is great to be used to perform roll-up calculations between categories and a good function to use in conjunction with other functions such as the IF and WHERE functions.


The RELATEDITEMS function is designed to return a collection of related items, either their name/external ID/internal ID. You can also specify the function to only return items that have a certain direction type in the relationship.


Syntax


RELATEDITEMS(x*,y*,z*,a*,b*)


* = OPTIONAL PARAMETERS. If no parameters are placed in the brackets, the function will return all item names that are related to the item in question irrespective of relationship direction.


Parameters


= Type, either name/external ID/internal ID. If left as NULL, name will be assumed.


= None direction. This can be set to TRUE or FALSE to define the search to a specific set of items that possess a relationship direction of NONE.


= To direction. This can be set to TRUE or FALSE to define the search to a specific set of items that possess a relationship direction of TO.


a = From direction. This can be set to TRUE or FALSE to define the search to a specific set of items that possess a relationship direction of FROM.


b = Both direction. This can be set to TRUE or FALSE to define the search to a specific set of items that possess a relationship direction of BOTH.


Type of Data Returned


This function will return an array of text, either names/External ID’s/Internal ID’s of items depending on the type set.


Examples


RELATEDITEMS() will return the names of all the related items.


RELATEDITEMS(‘internalid’) will return the internal ID’s of all related items.


RELATEDITEMS(‘name’, FALSE, TRUE, FALSE, FALSE) will return the names of all the items with a relationship pointing to this item.


RELATEDITEMS(‘externalid’, FALSE, FALSE, TRUE, FALSE) will return the external ID’s of all the items with a relationship pointing away from this item.