Sort an object array by numeric values that are stored as string using Power Automate



Recently I got a question in a previous post about the sort expression in Power Automate:

I am attempting to use this expression in a compose box to sort by a numeric ascending value, but it is sorting that value as if it were a word and not a number. How would I amend this expression to sort the array by a number value that is apparently stored as a text string?

Let’s have a look at the issue. If we have an array of objects as the below one in a compose action to be simple, with a integer value as String (number property):

[
  {
    "firstName": "Sylvester",
    "lastName": "Mavros",
    "country": "Sudan",
    "number": "1"
  },
  {
    "firstName": "Reed",
    "lastName": "Dunne",
    "country": "Cape Verde",
    "number": "10"
  },
  {
    "firstName": "Gabriel",
    "lastName": "Balenzuela",
    "country": "Hong Kong",
    "number": "4"
  },
  {
    "firstName": "Kory",
    "lastName": "Melot",
    "country": "Azerbaijan",
    "number": "30"
  },
  {
    "firstName":...



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...