Calculating a node name as the parent + an integer that adds 1 everytime a new child is added
Summary:
I'm trying to calcualte the node name as the parent node name contactactened with a string and an integer that adds 1 everytime a new child is added.
For example, if the parent is called, ABC-XYZ, underneath the parent I would like the child names to be calcualted as follows-
ABC-XYZ- Child1
ABC-XYZ-Child2
ABC-XYZ-Child3
I have tried the following expression however this is not working correctly, as every child is having value as, ABC-XYZ- Child1
{
return node.parent.name.concat("-Child", node.siblings.max(siblingNode => siblingNode.name).name.toInteger.add(1).toString)
}
Is there an alternative way I can amend the expression to get the required results?