Node List

Node list objects allow you to select node relationships in an expression. For example, after you add a node object to an expression, you can add the children object to further refine your expression.

After you add a node list object, you can add the following methods to that object. After you add a method, you must specify a condition for that method (depending on the method, this will be either a value that can be evaluated to a Boolean value, or a float, integer, or string value to be returned for each node in the list for the toFloatList, toIntegerList, and toStringList methods).

Method Description Parameters Example
Any Returns True if any of the nodes in a node list match the specified condition. The condition that the node list object gets evaluated against. any.childNode.properties.AccountType.equals(Expense) will return True if any of the children of the selected node have an account type of Expense.
Count Returns a count of the nodes in a node list that match a specified condition. The condition that the node list object gets evaluated against. count.childNode.properties.SourcePlanType.equals(Plan1) returns the number of children for a selected node whose source plan type is "Plan1".
Find Returns the first node in a node list that matches a specified condition. The condition that the node list object gets evaluated against. find.childNode.properties.Name.startsWith(A_) returns the first child of a selected node whose name starts with the letter "A_"
Get Returns the node in a list of nodes at the specified index The index (position in the list) of the node to get.

The position that you specify must be an integer value. Positive index numbers (or zero) count from the first index to the last, with zero being the first index. Negative index numbers count from last to first.

node.children.get(0) gets the first child node of a node
isEmpty Returns True if the node list is either null or empty. None node.properties.PLN.UDA (Account).IsEmpty returns True if the value of the PLN.UDA (Account) string list is either null or empty.
Reverse Returns the node list values in the reverse order. None node.ancestors.reverse returns a list of ancestors for a node in reverse (bottom up) order.
Size Returns the number of nodes in a node list.

Note:

The Size method is different from Count in that it does not require a predicate condition.
None return node.children.size.toString returns the number of children for a node as a string value.
toFloatList Returns a float value from each node in a node list

For methods, see Integer List and Float List.

None return node.children.toFloatList(childNode => childNode.properties.Ownership%).sum returns the sum of the ownership percentage for all children of a node.
toIntegerList Returns a integer value from each node in a node list

For methods, see Integer List and Float List.

None return node.children.toIntegerList(childNode => childNode.properties.Employees).size returns the number of employees across all child nodes.
toStringList Returns a string value from each node in a node list.

See List and String List for the methods that you can add to a string list.

None return node.ancestors.toStringList(ancestorNode => ancestorNode.name).join("|") returns a string list of ancestors for a node separated by "|".