web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Sort array results in ...
Power Automate
Unanswered

Sort array results in descending order

(0) ShareShare
ReportReport
Posted on by

Hi all, 

I'd really appreciate some help, I've created a flow which stores an array variable of key words and the count of the number of times they occur. 

I'm now trying to sort this array in descending order however I'm struggling with the expression to do this, I'd really appreciate some help in how I can do this?

Thank you,

Matthew5_0-1706034499582.png

 

Categories:
I have the same question (0)
  • Verified answer
    Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @Matthew5 

     

    Assume i have an array like below

    Nived_Nambiar_0-1706035199363.png

     

    Now will use below expression in compose action to sort the array in descending based on Count property 

    Nived_Nambiar_1-1706035246136.png

     

    Expression used: 

    reverse(sort(variables('arr1'),'Count'))
     
    This expression uses sort function to sort array variable by Count property in ascending order and then use reverse function to reverse it.
     
    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • Matthew5 Profile Picture
    on at

    Thank you very much!

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.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard