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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Sort function in a com...
Power Automate
Answered

Sort function in a compose action

(0) ShareShare
ReportReport
Posted on by 33

Hi Community,

I hope you're doing well!

I'm encountering an issue with sorting data in my Power Automate flow and could use your help.

My Situation:

  • I have a Compose action named "Compose_11" with the following output format:

Zotmani_0-1707528813238.png

  • I need to sort this data based on the OffreApresRectif field in ascending order.

What I've Tried:

  • I created another Compose action with the expression:

 

sort(outputs('Compose_11'), 'OffreApresRectif')

 

 The inputs of this compose action are : 

Zotmani_1-1707528959149.png

 

And the outputs are : 

Zotmani_2-1707528999099.png

 

  • This doesn't sort correctly because the OffreApresRectif field contains strings, where numbers are alphabetized. I tried converting them to integers but wasn't successful.

Could you please help me fix this issue and achieve the desired sorting?

Thank you in advance for your assistance!

 

Categories:
  • Verified answer
    SamLed Profile Picture
    2,340 Moderator on at

    Hi @Zotmani,

     

    Select all properties as string, add again the one you want to convert and convert its value using int() function, then sort Select output by that converted value, finally Select all string properties from sorted output.

     

    See current flow design to illustrate:

     

    SamLed_0-1707529434537.png

    SamLed_4-1707530783889.png

     

     

    Results:

    SamLed_3-1707530685164.png

     

     

    ______________________________________________________________

    If I have answered your question, please Accept the post as solution.
    If you like my response, please Thumbs Up.

     

     

     

  • Zotmani Profile Picture
    33 on at

    @SamLed Thank you very much, you saved my life, your method is working 🤓

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 389

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard