Showing results for 
Search instead for 
Did you mean: 

Sort Array

After fetching a list of items be able to sort the returned items before you use an Apply to Each.


You can filter an array.... Sort is the next obvious requirement.



Status: New
Kudo Collector

This is so frustrating.   Sorting an array was built-in Nintex back in 2007!   I have a large and complex query that I need to sort, but cannot find an action that sorts the array or even an expression... 😞

Kudo Kingpin

I found this manual for sorting an array: 



But.... it should be a built-in function in flows. 

Kudo Collector

There is also another blog post as a work around

Advocate IV

We need a Sort Array and a Deduplicate Array actions ASAP...

Not applicable

@testasdfasfsafa Deduplicating arrays can be done in one action using intersection().  An intersection of the array with itself will give you a deduped version.  This may or may not help your scenario, since it is only one action, it seems covered already, albeit not an obvious solution.

Kudo Collector

Deduplicating is not sorting. Maybe I want my duplicates and them sorted.

Regular Visitor

Is there still no built in action or function to sort an array?

Advocate IV

I'm afraid no one is working on Power Automate or managing these forums...  Important and foundational items have been stale for years making this forums a digital cemetery for good ideas and feedback.  It's clear Microsoft has moved on and not letting us, the pioneers, know what is going on.

Super User

I have also written up a method to do this, which is completely different from the loop based methods suggested by others. It is very easy to do, executes fast and you can implement very quickly:


How to sort an array in Power Automate 

Be interested to hear how you get on.




If I answered your question, please accept it as a solution 😘

Advocate IV

3 years later, and 254 people voted for this basic feature.  Yet, no one from Dev Team reads this stupid forum or update anything...  Why bother involving the community for free, then create a cemetery for their ideas or bug reports...  Epic Fail!