cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ilu989
Level: Powered On

Re-arrange the data by Alphabetical

Hi Everyone,

 

I have Original data string as below, is it possible to re-arrange(ascending) and accord to the specific item?

The specific @item()[11] is my target ascending item, the final data after ascending will become as After ascending.

 

Original data:

[
"ABC",
"KS",
"DND",
"",
"CE",
43117,
43152,
"CL",
"T124",
"CLi",
"CV",
364139,
364139,
"6D",
"",
"",
"",
"",
"",
"",
"",
"",
"CK",
"",
"",
43312,
"CJ"
],
[
"RK",
"GCE",
"DOD",
"",
"CE",
43267,
43203,
"POL",
"W123",
"CKOn",
"CMV",
345139,
364139,
"I453K",
"",
"",
"",
"",
"",
"",
"",
"",
"1CPKS",
"",
"",
43770,
"DIEKNSI"
],
[
"RNK",
"KKMA",
"OUPDA",
"",
"AE",
43667,
43603,
"CPO",
"ISOM",
"LOIN",
"CVOPNS",
404139,
364139,
"6M",
"",
"",
"",
"",
"",
"",
"",
"",
"21",
"",
"",
43670,
"LOJN"
]
 
After ascending:

[

"RK",

"GCE",

"DOD",

"",

"CE",

43267,

43203,

"POL",

"W123",

"CKOn",

"CMV",

345139,

364139,

"I453K",

"",

"",

"",

"",

"",

"",

"",

"",

"1CPKS",

"",

"",

43770,

"DIEKNSI"

],

[

"ABC",

"KS",

"DND",

"",

"CE",

43117,

43152,

"CL",

"T124",

"CLi",

"CV",

364139,

364139,

"6D",

"",

"",

"",

"",

"",

"",

"",

"",

"CK",

"",

"",

43312,

"CJ"

],

[

"RNK",

"KKMA",

"OUPDA",

"",

"AE",

43667,

43603,

"CPO",

"ISOM",

"LOIN",

"CVOPNS",

404139,

364139,

"6M",

"",

"",

"",

"",

"",

"",

"",

"",

"21",

"",

"",

43670,

"LOJN"

]

 
Regards,
ilu989
3 REPLIES 3
Community Support Team
Community Support Team

Re: Re-arrange the data by Alphabetical

 

Hi @ilu989 ,

 

You may need to sort the numbers first, and then sort the array elements. Currently, Flow has no direct action to achieve this requirement.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ilu989
Level: Powered On

Re: Re-arrange the data by Alphabetical

Hi @v-bacao-msft ,

 

Thanks for your tips, I found Liu's Blog might help on this:

http://johnliu.net/blog/2018/12/how-to-implement-sort-with-microsoft-flow-in-3-actions-within-a-loop

But, my situation is the numbers are not unique, sometimes have the repeat number display in different elements, so Liu method can't suite in my case, do you have a more specify method can teach me? Thank you very much.

 

Regards,

ilu989

Community Support Team
Community Support Team

Re: Re-arrange the data by Alphabetical

 

Hi @ilu989 ,

 

If number is not unique, I'm afraid it's impossible to sort. Because we need it as a key column to sort and extract the elements contained in the array.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users online (4,901)