Sort objects action node then iterate the sorted list

Hi,

We want to sort a data source, then iterate this newly sorted data source.

However, I cant get it to sort. Is it because it is not possible to first sort and then use this order? Does it revert back to the old sorting when starting the iteration?

Screenshot 2024-05-28 at 10.13.10

1 Like

Hello Sinan,

In the devTools, can you see if the objects are sorted correctly before the loop is executed? :slightly_smiling_face:
Also, which browser are you running the app in?

// Erik

Thanks for the reply.

How should I see if they are sorted correctly before the loop? Sort objects does not return anything. I have tried to log to console in the for each to see the order, but it is not correct.

Screenshot 2024-05-28 at 10.25.18

Using Google Chrome.

You can observe the objects being sorted in the devTools. If you’re working with a service, you will need to setup a breakpoint at the sort-action node and the for-each action node in order to observe the datasources :slightly_smiling_face:

// Erik

1 Like

Thank you, I managed to fix it :slight_smile:

1 Like

Glad to hear it! :smile:

// Erik

1 Like