Skip to main content

Notifications

Power Automate - General Discussion
Suggested answer

Sort HTML table in Power Automate

(1) ShareShare
ReportReport
Posted on by 45
Hello,
 
I want to sort my HTML table by the delay value, from negative to positive value. I use sort expression and already state based on which column. But somehow the result is still in a messy order. Did I write the expression correctly or is there any other way to sort the value? Also, I want the sorting to start from -7 to the positive value.
 
The expression
sort(outputs('Compose_System_Table'), 'Delay')
The flow
 
 
The result
Categories:
  • veracruz Profile Picture
    veracruz 45 on at
    Sort HTML table in Power Automate
    Hi @FLMike,
     
    I got it now, thank you.
  • veracruz Profile Picture
    veracruz 45 on at
    Sort HTML table in Power Automate
     
    I got it now, thank you.
  • Suggested answer
    FLMike Profile Picture
    FLMike 30,517 on at
    Sort HTML table in Power Automate
    HI
     
    I believe the issue is you are sorting based on a string column versus an int column. then comparing that to a int() then a number.
     
    Your sort will be incorrect if you are sorting by strings, not actually numbers hence your issue .
  • Expiscornovus Profile Picture
    Expiscornovus 31,104 on at
    Sort HTML table in Power Automate
    I noticed you are using an int function in your filter array action criteria/where statement. Are the values in the Delay column of type string/text? Can you share sample of the Compose System Table outputs?
     
    Your expression syntax seems fine btw. Below is a test with a sample array to demonstrate the same approach in a Select action
     
    IntArray with some sample data underordered (with a Delay column which has integer values)
    createArray(json('{ "first": "Amalie", "Delay": -3 }'), json('{ "first": "Elise", "Delay": 3 }'), json('{ "first": "John", "Delay": -7 }'), json('{ "first": "Jane", "Delay": -4 }'))
     
     
    Expression in the Select action
    sort(variables('IntArray'), 'Delay')
     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard