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
More About This Author
-
SharePoint and Office 365 Consultant/Developer always trying to get the best from Microsoft stack (Microsoft 365/Azure/Power Platform and related stuff).
Living in Ireland since 2018, I had previously worked in Brazil as a consultant/developer for Office 365, SharePoint and related technologies for almost 10 years.
Array
- Modern Workplace1 May 2024Using the new ‘Send a Microsoft Graph HTTP request’ action in Power Automate to send urgent messages in Microsoft Teams
- Modern Workplace13 April 2024Power Pages and Cloud Flows – Validate user against Dataverse records based on Contact ID
- Modern Workplace6 April 2024Download SharePoint library files in Power Pages with JavaScript and Cloud flows – Improved code using jQuery & option to open PDF file in a new tab
- Modern Workplace13 March 2024Handle multiple N:N records associate and disassociate requests with JavaScript and Power Pages Web API