Solved
Forum Discussion
cjhoward18
6 years agoEmployee
Yes, indexOf() returns the index not the value.
Using your example data in a json generator, and a mapper with this expression:
$items.map(value => value.extend({'Data_Index':$items.indexOf(value)}))
you will see that the original map uses extend to add the index of each element to a new field ‘Data_Index’ in each value in the list.
arvindnsn
6 years agoContributor
That worked wonderful!! Thanks a lot for the help. Much Appreciated.
- nsingam7 years agoEmployee
Hi Biksah,
You can use the Json Splitter snap. As per your example, in the Json Splitter snap for the field Json Path provide the value as $Cost_Center_Hierarchies[*], and select the Include scalar parents check box. Hope this is what you are looking for.