Build a string in a loop
I have a For Each loop and I need to concatenate elements each time around to the string to be used later in the workflow.
I just can't work it out.
-
I am not completely sure what you want to achieve and what you meant by 'Elements'. But here is what you may try.
- Create array object using 'Create Value' activity. say = []
- On For-Each, you get whatever object from the For-Each collection item, and Add it to the [] using 'Add Item' activity inside each For-Each loop
- After finishing For-Each activity, you have now the update [] with the values to use later on your workflow step
Does it make it sense?
Moon 1
0 -
By element I meant, I am needing to build a sting by appending the coordinates of the point each time around.
Your solution makes complete sense for the creation of an array (or collection) but I felt like I had a circular reference when I used the "Create Value" activity. I need to be able to Update the 'value'.
BTW thanks for the rapid response 😁
0 -
Hi Robert,
I've attached a sample workflow of how to achieve this. Within the For Each loop, you can use this syntax to concatenate: =$value1.result += $forEach1.item
Thanks, Stefan
0 -
Ahh excellent!!!
The trick is the "Evaluate Expression" activity
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
4 commentaires