Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Lets say we have a custom list variable with these items:
A1
X2
G3
S4
I want to loop over the list in descending item position order:
S4
G3
X2
A1
Applying the sortdesc formula on the list does not what I want
X2
S4
G3
A1
How to sort desc by list item position? Is this even possible or are there any other workarounds?
Hi @p0cket0m
One way is to use the Custom Code block, it ingests the list and then you can use one of the programing languages lets say node js to use the reverse array method on the array.
Then console log the the stringified array value, that will in turn let you use the values from the custom code block outside of it in other blocks down the line.
I am also sure there is a less cleaner way to do this with simply a loop, by storing the length of the array in a variable and subtracting 1 from it on each iteration of the loop, then using that as an index to access the array item in formula mode.
Best Regards