Skip to main content
Community site session details

Community site session details

Session Id : /a/LiFNN7OHQh/sdpt3f4q
Power Automate - General Discussion
Answered

Convert From multireply string into a valid array

Like (2) ShareShare
ReportReport
Posted on 21 Jul 2017 09:53:22 by 24

Hello,

 

I getting headach converting a string into a array with Flow in order to iterate for each items.

 

I trying trigger a MS Flow for when a MS Form is submited. The Form contains a multiple options question. My issue is I can't found a way to itterate for each option selected.

 

Here is the question where I selecte Options and 3:

 

2017-07-21_11h13_26.png

Here is my flow:

Note that the compose action has no real puposes it is just to visualise the output for the question. 

 

2017-07-21_11h32_37.png

 

This is generating an error

 

ExpressionEvaluationFailed. The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@@createArray(@outputs('Compose'))' is of type 'String'. The result must be a valid array.

 

The output of the question reply is a string like ["Option 1","Option 3"]. How can I convert this into a valid array?


2017-07-21_11h43_45.png

 

 Many thanks in advance,

 

 

 

 

  • MaxBarrass Profile Picture
    18 on 06 Dec 2021 at 03:31:34
    Re: Convert From multireply string into a valid array

    Just create an expression and do this

     

    json(outputs('Get_response_details')?['body/r555abb6d4c254b339a5731eda30d9c3e'])
  • danishpowerapps Profile Picture
    66 on 22 Nov 2021 at 12:19:32
    Re: Convert From multireply string into a valid array

    Forms multiple choice --> Sharepoint List look no further: John Liu has a better solution:
    https://www.youtube.com/watch?v=dNZydb1QH4o&ab_channel=JohnLiu

     

  • sklein09 Profile Picture
    4 on 27 Sep 2020 at 22:02:52
    Re: Convert From multireply string into a valid array

    Can you please show what your expression was to correct this?

  • Verified answer
    Gaetan Profile Picture
    24 on 29 Jul 2017 at 08:13:57
    Re: Convert From multireply string into a valid array

     

    I was finally able to have this work. In the the Apply to each output from previous steps i'm converting the string array from Form reply into a JSON. This is generating a valid array that the Apply to each will iterate through.

     

     

    Sans titre.png

  • Gaetan Profile Picture
    24 on 24 Jul 2017 at 11:58:52
    Re: Convert From multireply string into a valid array

    Hello @v-micsh-msft,

     

    Thanks for your feedback.

     

    I tryiedto passthe compose output directly to the Foreachbut it fails:

     

    ExpressionEvaluationFailed. The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Compose')' is of type 'String'. The result must be a valid array.

     

    Seems like it is concideredas a string and not array.

     

    What do you think?

     

    2017-07-24_13h50_49.png

    2017-07-24_13h47_30.png

     

     

     

  • v-micsh-msft Profile Picture
    on 24 Jul 2017 at 08:47:55
    Re: Convert From multireply string into a valid array

    Hi @Gaetan,

     

    The output of the first Compose is already an Array.

    Please take a try to add the compose Output directly without the formula, see if it would work for the Apply to each.

     

    Besides, if you would like to have the array elements into one string, then we need to use Join in another Compose, the formula should be:

    "@join(outputs('Compose'),',')"

    Regards,

    Michael

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

Announcing our 2025 Season 2 Super Users!

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

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!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading started
Loading complete