Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Problems with Select action output array inserting unwanted characters/Compose output not being an array

(1) ShareShare
ReportReport
Posted on by 15

Hi everyone.

I'm looking to maximise efficiency by reworking an existing flow. The section in particular that I am trying to replace uses a Get items -> Apply to each item -> Append to array variable approach. I have managed to improve other flows by replacing these sections with Get items -> Select -> Append to array variable, as this allows me to add everything I need to the array all at once, instead of one item at a time.

Below is my attempt at applying the Select approach to this particular flow:

We start with a simple Get items -> Select, to reformat the output of Get items while trying to avoid a silly Apply to each -> Append to array variable approach.

PD96_1-1663862863436.png

Note that I am trying to produce a nested output.

However, the output of the Select action insert unhelpful characters:

PD96_2-1663862949877.png

Now I can use a Compose action to remove incorrect characters using a few replace() functions.

PD96_3-1663863044455.png

This gives me something that looks exactly like the output I need. However, this output is now a string where I need an array.

Is there a way I can force Power Automate to treat this output as an array? Aside from the lack of line breaks, this string output looks identical to the array output that the existing flow produces, 

  • PD96 Profile Picture
    15 on at
    Re: Problems with Select action output array inserting unwanted characters/Compose output not being an array

    Thanks for the help @Sundeep_Malik, I promise I tried Parse JSON before giving up and coming to the forums, but as is often the case I just needed to take a step back and go step by step from the beginning to get things working 😁 Thanks also @abm for the help!

  • Sundeep_Malik Profile Picture
    6,482 on at
    Re: Problems with Select action output array inserting unwanted characters/Compose output not being an array

    @abm 

    Oops just noticed those double quotes. Hehe.

  • abm abm Profile Picture
    32,506 Most Valuable Professional on at
    Re: Problems with Select action output array inserting unwanted characters/Compose output not being an array

    Hi @PD96 

     

    The reason you are getting the "\" characters is because you have added double quotes around your Dynamic values (eg: ID & _metadata). Thats the default behaviour. Not sure why you want to remove these. You can still pass the output of the Select action step to a Parse JSON action step to iterate the values and that will output the values including the double quotes.

     

    If you still want to use the compose and convert back to array what you need to do is. Extend the compose output to replace the '[' (Left)  and ']' (Right) brackets. Then add a new compose action step, use the array() expression to convert back to an array.

     

    Thanks

  • Sundeep_Malik Profile Picture
    6,482 on at
    Re: Problems with Select action output array inserting unwanted characters/Compose output not being an array

    Hey @PD96 

    Do it like this:

    You will not need to use replace then.

     

    Firstly use a compose action, pass values of get items.

    Save your flow, and run and test.

    Then from the flow run only, copy the output you are getting in that compose.

    Then come back to the flow.

    Use parse json action.

    use the output of above compose and paste the copied part in generate from sample.

    After that use select to get the fields you want.

     

    Sundeep_Malik_1-1663865053067.png

     

    Output I am getting after select:

     

    Sundeep_Malik_0-1663865031400.png

     

  • Verified answer
    Sundeep_Malik Profile Picture
    6,482 on at
    Re: Problems with Select action output array inserting unwanted characters/Compose output not being an array

    Hey @PD96 

    Try using parse JSON. It might help.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1