Grouping collections
.groupBy()
allows nodes to be grouped by one or multiple properties
These grouped results can then be exported from the Gizmo editor for use outside orgvue
groupBy()
follows this general syntax
nodes().groupBy(['propertyA', 'propertyB'] )
In this example of grouping all nodes by location and department:
nodes().groupBy(['location','department'])
- The expression is run in the Gizmo editor
- The results are shown in the results window with the node UUID being shown as the value
- Using the
Copy results
function of the Gizmo editor - The results can then be pasted into notepad or other text editors
- When pasted the results will display the node label for each node in the group
groupBy()
can be used with count to perform calculations or counts on records or other property values
nodes().groupBy(['location','department']).count
The addition of .count
to the expression will return a count of the groups