New Sorting actions for arrays/tables In Power Automate: sort & reverse

michelcarloModern Workplace2 years ago5 Views



Until recently it was not possible to easily sort arrays or collections of objects in Power Automate using a single expression, either complex logic techniques or Office Scripts were required.

But recently two new handy expressions became available in Power Automate that make it really simple to do:

  • sort
  • reverse

How the sort expression work

The sort expression accepts either an array with simple values or a collection of objects.

If you pass a simple array to the expression, no parameter is needed. For example, if you have the following array variable with people’s names:

[
"Michel",
"Nick",
"Michael",
"Carlos",
"Renan"
]

By using the sort expression as below:

sort(variables('Names'))

You will get as output:

[
  "Carlos",
  "Michael",
  "Michel",
  "Nick",
  "Renan"
]

If you have an array/collection with objects, you need to specify a property to use in the sorting, so for example, consider an array variable named ‘NamesCountries’ as below:



Source link

Leave a reply

Join Us
  • X Network2.1K
  • LinkedIn3.8k
  • Bluesky0.5K
Support The Site
Events
February 2025
MTWTFSS
      1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28   
« Jan   Mar »
Follow
Sign In/Sign Up Sidebar Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...