Wednesday
Hi there,
I have a recipe that creates sales orders (header and lines) in Dynamics 365 F&O (ERP).
I use a repeat for each action to create the sales order lines. The step input list is a list of the relevant line item data which includes a sequence number field.
I cannot guarantee the input list is sorted / ordered by the sequence number, but, I do want to create the D365 sales order lines in sequence number order.
What's the recommended way to sort / order the input list so that I can control the order that the repeat for each action iterates through the list?
I'm sure I'm missing something obvious, but I've not been able to find an answer in the documentation or these boards.
Thanks in advance.
Solved! Go to Solution.
Wednesday
I don't know of a native way to do this without using loops and a billion tasks.
I would use a Ruby or JS action to sort the array. Ruby sorting is pretty straightforward:
array.sort_by{ | a | a["sequence_number"] }
Wednesday
I don't know of a native way to do this without using loops and a billion tasks.
I would use a Ruby or JS action to sort the array. Ruby sorting is pretty straightforward:
array.sort_by{ | a | a["sequence_number"] }
Wednesday
Thanks Gary, Iโll give that a go.
Thursday
That worked a treat! Thanks again Gary.