Notifications
Announcements
Hi! I'm building an array dynamically in flow and would like to order (sort) the data in the array. How can I acheive it?
Hi @PWrobel ,
This is the easiest approach, using an azure function:
https://veenstra.me.uk/2019/07/13/sort-an-array-or-collection-in-microsoft-flow/
Thanks Pieter. To bad there is nothing out of the box that does not require access to Azure subscription.
I have the same issue but find two websites for me to solve it, it might help you to achieve your requirement:
http://johnliu.net/blog/2018/12/how-to-implement-sort-with-microsoft-flow-in-3-actions-within-a-loop
The answer from "v-bacao-msft"
https://powerusers.microsoft.com/t5/Building-Flows/Create-Update-Sharepoint-List-using-an-Excel-List-using-Flow/td-p/297835
Good luck!
ilu989
Thanks Ilu
I was thinking about building my own sort function in loop, so now I can just copy it 🙂
If you need a build-in function, please vote for this idea:
https://powerusers.microsoft.com/t5/Power-Automate-Ideas/Sort-Array/idc-p/486807#
TRY THIS EXPRESSION (as an Expression for a Compose Action in Flow):
(Assume that "my_array" is the array of POSITIVE INTEGERS that you want to sort.)
Expression (For Ascending Sorting):
I like the solution by @Paulie78 (https://www.tachytelic.net/2022/07/power-automate-sort-json-array/), it's more universal as it can handle objects and decimal numbers as well.
Finally: there is a sort() expression available.
And with reverse() you can also do descending sorting.
By the way: I cannot find the ideas section anymore... 😞
I did a video on the new expressions:
How to sort arrays in Power Automate.
Blog: tachytelic.net
YouTube: https://www.youtube.com/c/PaulieM/videos
If I answered your question, please accept it as a solution 😘
I can't find this.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Michael E. Gernaey 538 Super User 2025 Season 2
Tomac 405 Moderator
abm abm 252 Most Valuable Professional