web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Multiple Choice data f...
Power Automate
Unanswered

Multiple Choice data from Microsoft Forms

(2) ShareShare
ReportReport
Posted on by 144

Hi,

I have a SharePoint list with data from a Microsoft Forms survey. One of the fields is a multiple choice field where the data looks like this:
["Option 1","Option 2","Option 3"]

 

I'm not sure if this is an array, but I'm trying to turn the above into the string below:

Option 1; Option 2; Option 3

 

Any idea how this could be done?

Categories:
I have the same question (0)
  • Jay-Encodian Profile Picture
    2,920 on at

    Hey @McMonty 

    The following solution works albeit it it way more complex than I'd like!

    1.png

     1. Create an array of chars which need to be removed from the string: createArray('[',']','"')

    1.png

     2. Add a variable to store the 'Initial value' I've manually set the value...

    1.png

     3. Add a new variable to store the changing / new value

    1.png

    4. Add an 'Apply to each loop'

    5. Set the 'Output from previous steps' to the array variable created in step #1

    6. Add a 'Set Variable action', add the following expression: replace(variables('InitialValue'),item(),'')

    1.png

     7. Add a 'Set Variable action' to copy the NewValue to the InitialValue variable... you can't self reference in the replace expression 😞

    1.png8. Finally... Add a another 'Set Variable' action underneath the 'Apply to each' loop to perform the final replace expression: replace(variables('InitialValue'),',','; ')

    1.png

     Your Flow config should look like this... a little convoluted but it works!:

    1.png

    HTH

    Jay

    -------------------------------------------------------------------------

    If I have answered your question, please mark your post as Solved.

    If you like my response, please give it a Thumbs Up.

     

  • Jay-Encodian Profile Picture
    2,920 on at

    Hey @McMonty 

    So this was really bugging me yesterday... I thought there must be an easier way! and there is!

    I forgot about the 'Join' action... much simpler:

    a.png

     

    a.png

     

    A little bit simpler!

    HTH

    Jay

    -------------------------------------------------------------------------

    If I have answered your question, please mark your post as Solved.

    If you like my response, please give it a Thumbs Up.

  • A Wennerwik Profile Picture
    144 on at

    Hi, my only question is where in the previous solution do I add / replace this?

  • Jay-Encodian Profile Picture
    2,920 on at

    Hi @McMonty 

    The second post totally replaces the the first post... they are both complete answers that do the same thing in a different way.

    The second post is obviously a lot simpler...

    All you really need is the 'Join' action passing in your Form data... that's it 🙂

    HTH

    Jay

    -------------------------------------------------------------------------

    If I have answered your question, please mark your post as Solved.

    If you like my response, please give it a Thumbs Up.

     

  • Verified answer
    v-litu-msft Profile Picture
    on at

    Hi @McMonty,

     

    The output of the Choice type answer for MS Form will be string, so the only way to process the string to you want is some part of @Jay-Encodian's method 1.

     

    You can add the replace function in the right Expression Bar:

    Annotation 2019-12-02 170039.png

     

     

    You can try this expression, the variables('Choice') is the output of your Choice answer:

    replace(replace(replace(replace(variables('Choice'),'[',''),']',''),',',';'),'"','')

     

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

  • Verified answer
    Jay-Encodian Profile Picture
    2,920 on at

    Hey@v-litu-msft @McMonty 

    To parse the string to an array use the JSON expression:

    a.png

    Expression: json(<formVariable>)

    a.png

    Super simple 🙂

    HTH

    Jay

  • A Wennerwik Profile Picture
    144 on at

    Hi all,

     

    Big thanks to you both!

     

    I created a variable containing the data from the multiple choice field and then used replace to get the string I wanted when creating the SharePoint item.

    replace(replace(replace(replace(variables('Choice'),'[',''),']',''),',',';'),'"','')

    You learn something new everyday 🙂

    You learn something new every day 🙂

     

  • DanielS19 Profile Picture
    9 on at

    Hello Everone!

    Thank you for solved !

    Is it possible to skip lines for each string received from this solution?

  • lbernstein Profile Picture
    3 on at

    How would you format the Body if you wanted the output to be the following?

     

    Option 1

    Option 2

    Option 3

  • Jason3675 Profile Picture
    17 on at

    You can use the following expression in a Compose function: join(outputs('ConvertResponseToJSON'),'<br>')

    Jason3675_0-1642811526740.png

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard