Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 23wFUuUEn+5sr5W9v9TT9Y
Power Automate - Using Connectors
Answered

Re-location the Character with string

Like (0) ShareShare
ReportReport
Posted on 16 Dec 2019 03:45:44 by 164

Hi Everyone,

 

I know how to collect the data used "apply to each" and transfer String to the Array, like this:

 

Data:

Capture_string.JPG

 

 

Result:

Capture_string2.JPG

 

 

This time, I need to re-location the data in the string, and use apply to each to the further application:

 

The original data:

[

[

"54573",

"AB",

"",

"40",

"U18",

"Dd",

"Dd",

"522",

"4KP",

"4HP"

],

[

"2345",

"KC",

"",

"43",

"U28",

"Dd",

"Dd",

"533",

"4KP",

"4HP"

]

]

Transfer to the result:

[

[

"40",

"",

"U18",

"4KP",

"522"

],

[

"43",

"",

"U28",

"4KP ",

"533"

]

]

 

I already use apply to each and set variable:

[item()[3], item()[2], item()[4], item()[8], item()[7]]

But the data collection used Append to string will become :

[["40","","U18","4KP","522"]["43","","U28","4KP ","533"]

And can't used in Apply to each for further application, even use  @{replace(variables('Re_arrange header_2'), '][', '],[')}

 

While used Append to Array, it has to be {"AB": item()[3], "BC": item()[2].............}

Capture-string3.JPG

 

I stunk in here a few days, can somebody help me or give me the tips? Thanks

 

Regards,

ilu989

  • ilu989 Profile Picture
    164 on 20 Dec 2019 at 16:48:40
    Re: Re-location the Character with string

    Hi @v-bacao-msft ,

     

    Thanks for the support! It let me eye-opener and learns the new method to use Apply to each and output expression, thanks again!

     

    ilu989

  • Verified answer
    v-bacao-msft Profile Picture
    on 20 Dec 2019 at 09:37:18
    Re: Re-location the Character with string

     

    Hi @ilu989 ,

     

    Please use this method. Import Flow and test it.

     

    Best Regards,

  • v-bacao-msft Profile Picture
    on 16 Dec 2019 at 07:58:58
    Re: Re-location the Character with string

     

    Hi @ilu989 ,

     

    I'm trying, but if the array elements are also arrays, it seems like a difficult situation to deal with.🤔

     

    Best Regards,

  • ilu989 Profile Picture
    164 on 16 Dec 2019 at 07:56:32
    Re: Re-location the Character with string

    Hi @v-bacao-msft ,

     

    Thanks for your reply!

    I need the Array to be used in the Apply to each!

    The String can not be applied to the further Apply to each:

    Do you have any other way to overcome this situation? Thanks

     

    Capture-string4.JPG

    Regards,

    ilu989

  • v-bacao-msft Profile Picture
    on 16 Dec 2019 at 07:32:05
    Re: Re-location the Character with string

     

    Hi @ilu989 ,

     

    I want to confirm your needs first. Is every element in the array also an array? It seems more reasonable here if it is Object.

    I tried on my side according to the data you provided, but the results did not seem to be very good. The final result cannot be used by Apply to each. Because it is a string, it cannot be converted to an array.

    Please import the flow in the attachment, and then see the specific steps.

     

    Best Regards,

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

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

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

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,369 Most Valuable Professional

Leaderboard

Featured topics

Loading complete