I got this array in server connect called LineItems. I want to modify all array list items of this array where the merchantid is equal to the repeat object’s merchantid like this:
However, I can’t get that to work? How can I set the correct index expression for the lines to adjust values for?
The first merchantid from the Set Array List Index expression LineItems.where('merchantid', '==', merchantid) is the LineItems merchantid value by the way and the second one it’s compared to is the merchantidfrom the repeat loop object.
Thanks for any help in advance. Have been struggling with this for a while yet.
Works as expected, except the last step (Set Array List Index Properties) is not updating the Item value(s) in the LineItems Array List. How can I fix that?
That one throws an error: “arraylist.set: index is required.”
I also can’t use “Array List Index of” to get a list of indexes for the items to set a new value for, because “Array List Indexof” only works on text arrays as mentioned on @Hyperbytes‘ amazing tutorial. LineItems is an object array: `"LineItems": [{"title": "Test 123","amount": 24,"quantity": 1,"currency": "eur","totalproductvalue": 23,"totalshippingcosts": 1,"totalamount": 24,"merchantid": 6}]`
So I’m quite stuck here, hoping someone can help me out
Also, it’s not possible to set an Item’s value to zero in “Set Array List Index Properties”. After saving the field is empty then again. Any other value can be set without issues.
Got it working! Actually, it was working properly al along, I just had to insert a new “Get Array List Value” after the repeat holding the “Set Array List Index” actions and use the updated values in that Value further along.
Regarding this:
That’s also working fine if an Item is set to set to zero, however in the “Set Array List Index Properties” settings list that “0” value is not visible after saving and reviewing the properties. It is visible in the json code however, so seemsto be a small UI bug.