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 / Using sort function to...
Power Automate
Unanswered

Using sort function to sort complex Compose action outputs

(0) ShareShare
ReportReport
Posted on by 33

Hi Community,

I hope you’re doing very well.

I need your help to solve a problem.

This is the output of a Compose action in my flow:

Zotmani_0-1708738140402.png

My goal is to sort these objects by the sum of TF and TC, such that the one with the smallest sum is the first and so on.

This is the Append to Array action that fills the Compose block:

Zotmani_1-1708738353045.png

Before, in a different Compose action, I was able to achieve this using Select block, but in a different context. I’m not sure if I can do it again with multiple data:

Zotmani_3-1708738686005.png

Zotmani_2-1708738422171.png

Thank you very much for your help and support.

Categories:
I have the same question (0)
  • lbendlin Profile Picture
    8,551 Super User 2026 Season 1 on at
    My goal is to sort these objects by the sum of TF and TC

    You would have to isolate these out, into separate array attributes, unless you want to do some elaborate string math. Don't you need those values later on anyway?

     

    Once they are separate fields the rest should be straightforward.

     

    5 Ways to Sort an Array in Power Automate - Power Tech Tips

  • devtollon Profile Picture
    24 on at

    You can't do out-of-the-box because in your array everything is a string (and you can't do math on a string).

     

    First of all, you need extract the numeric values you want to sum and convert them as integers (if you want to be a little "rough" you can split the string on the middle dash, split it again on the colon and take the last value or you can create a regular expression and retrieve the values you need which is definitely a better and smarter solution).

     

    Once you have the integer values, you can sum them and make all the sorting logic you need.

     

    Let me know if this solved your issue!

  • Matthy79 Profile Picture
    4,186 Super User 2024 Season 1 on at

    I don’t understand what you are doing.

     

    Why do you have an append to array?

    Why don’t you add a sort column if you do it that way?

     

    Can you show your flow?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 60 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 54

#3
Expiscornovus Profile Picture

Expiscornovus 47 Most Valuable Professional

Last 30 days Overall leaderboard