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 / Form to Sharepoint tem...
Power Automate
Unanswered

Form to Sharepoint template - ["How do I get rid of the square bracket and quotation marks from my multiple choice options?"]

(0) ShareShare
ReportReport
Posted on by

I'm totally new to flow so please bare with me... I've set up my first flow today. My objective was to get data from a MS form to a SharePoint list so I used the template an 90% of it was as expected. I found it straightforward to link fields from Forms to the columns in my SP list. So good so far, but then the data is coming from an multiple choice in Forms I'm getting ["Text"] in the SP List. I suspect it something really simple but it isn't obvious to me. Any ideas?MS Forms to SP via Flow tempalte.PNG

Categories:
I have the same question (0)
  • Verified answer
    v-yamao-msft Profile Picture
    on at

    Hi @TomHughes ,

     

    Do you want to save multiple selections from Forms to SharePoint list?

     

    I have made the following flow for your scenario, please check it for a reference.

     

    Add the trigger When a new response is submitted. In the form, I have a multiple selections enabled field.

     

    Initialize variable, set its Name as Test, Type as Array.

     

    Get response details. An Apply to each will be added automatically after you select the response Id.

     

    Add a Compose action to remove all the special characters:

    replace(replace(replace(body('Get_response_details')?['rb12b59186b54449d83e54595ebe4eb10'],'","','|'), '["',''), '"]','')

     

    Add a Compose 2 action to split the previous output into an array:

    split(outputs('Compose'),'|')

     

    Add an Apply to each 2, select value from compose 2 output, add the action Append to array. Here, set its name as Test, Value as dynamic content Current item of Apply to each 2.

     

    Under the Apply to each 2, add Compose 3 with the following code:

    join(variables('Test'),',')

     

    Add the action Create item to add the output of Compose 3 to corresponding column.

     

    Images for your reference.

    1.PNG2.PNG

     

    Best regards,

    Mabel

     

  • PMac Profile Picture
    84 on at

    @v-yamao-msft  I have the same issue and just trying your suggested workaround, however I am getting the this error in the first 'compose'.  

     

    InvalidTemplate. Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2578': 'The template language function 'replace' expects its first parameter 'string' to be a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#replace for usage details.'.

     

    Any suggestions?  Thanks

  • patspurrier Profile Picture
    19 on at

    While the accepted solution will work, I feel obligated to reply incase anyone comes here looking for help with the same issue. @

     

     

    replace(replace(replace(body('Get_response_details')?['r676aaefb8a4b4a6c81675db2517d6e1d'],'","',', '), '["',''), '"]','')

    Just replace the "body('Get_response_details')?['r676aaefb8a4b4a6c81675db2517d6e1d']" with the dynamic content of the multiple choice response question.

     

     

    Flow for forms.PNG

     

  • patspurrier Profile Picture
    19 on at

    <deleted>

  • Community Power Platform Member Profile Picture
    on at

    Thanks for sharing @patspurrier this worked perfectly for what I was needing - if only I had come across your post earlier. Will link this to the one I created 🙂 

  • Community Power Platform Member Profile Picture
    on at

    Thanks for your example.  I'm getting close, but the multi choice field in my form is showing up as blank in my SharePoint list.  Could you show exactly what is in your replace function for the Fixed attribute.  I've not been able to interpret your instructions of 

    "Just replace the "body('Get_response_details')?['r676aaefb8a4b4a6c81675db2517d6e1d']" with the dynamic content of the multiple choice response question"

     

    TIA

  • patspurrier Profile Picture
    19 on at

    @Anonymous,

    This is exactly what is in my Fixed sharepoint field:

    replace(replace(replace(body('Get_response_details')?['r676aaefb8a4b4a6c81675db2517d6e1d'],'","',', '), '["',''), '"]','')

    After you paste this expression into the expression area, you'll have to modify it to point to your response. Just backspace out the "'Get_response_details')?['r676aaefb8a4b4a6c81675db2517d6e1d']", go to dynamic content and select your response, then click OK.

  • Community Power Platform Member Profile Picture
    on at

    @patspurrier 

     

    It appears I have multiple issues with my flow.  I was able to figure out what needed to be replaced in the formula, but I appreciate your response. 

     

    It seems the only way I can get the multiple choice Form responses to display in my SharePoint list is to have the column configured as text.  I would have thought the proper format would be multiple choice, choices defined the same as in the Form, and checkboxes selected.  Any idea why it only works when the column is configured as text?

     

    TIA, again.

  • Community Power Platform Member Profile Picture
    on at

    Thank you so much! I was battling this for over an hour😁

  • jasonmurphy Profile Picture
    34 on at

    Hi Folks,

    I've been trying to use this solution to clean up the "\n" characters that get added to a MS Forms Choice response, which is getting added to a SharePoint List calculated column. I've inserted this expression:

     

    replace(body('Get_response_details')?['re161b12e16c941ba887a822bf85f74d3'],'\n','')

     

    Unfortunately, the form output, via the expression is continuing to include the "\n" characters.

     

    Any suggestions would be greatly appreciated.

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