SOLVED

Some Form questions are getting brackets [ ] around answers, \n at the end, and/or <br> at the end.

%3CLINGO-SUB%20id%3D%22lingo-sub-3043549%22%20slang%3D%22en-US%22%3ESome%20Form%20questions%20are%20getting%20brackets%20%5B%20%5D%20around%20answers%2C%20%5Cn%20at%20the%20end%2C%20and%2For%20%3CBR%20%2F%3E%20at%20the%20end.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3043549%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20Form%20that%20triggers%20a%20flow%20when%20submitted.%20That%20flow%20puts%20the%20Form%20data%20into%20a%20SharePoint%20list.%20There's%20a%20couple%20questions%20on%20the%20form%20that%20consistently%20get%20brackets%20%3CSTRONG%3E%5B%22answer%22%5D%20%3C%2FSTRONG%3Earound%20the%20answer%20and%20sometimes%20the%20same%20question%20will%20have%20the%20brackets%20and%20a%20%5Cn%20at%20the%20end%20like%20%3CSTRONG%3E%5B%22answer%5Cn%22%5D%3C%2FSTRONG%3E.%20There's%20another%20question%20that%20inconsistently%20gets%20a%20%3CBR%20%2F%3E%20put%20at%20the%20end%20of%20the%20answer%20%3CSTRONG%3Eanswer%3CBR%20%2F%3E%3C%2FSTRONG%3E.%20I've%20tried%20deleting%20the%20questions%20with%20the%20problem(s)%20and%20re-creating%20them%2C%20but%20the%20issue%20persists.%20The%20problem%20seems%20to%20lie%20within%20Forms%20and%20not%20Flow%20or%20SharePoint%20because%20when%20I%20check%20the%20response%20details%20within%20Forms%20I%20see%20answers%20getting%20the%20extra%20stuff%20it%20shouldn't%20get.%20Here's%20some%20screenshots%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EQuestion%20and%20answers%20in%20Forms%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22What%20my%20questions%20look%20like%22%20style%3D%22width%3A%20813px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F335343i4F99A30F9D610ADA%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222021-12-21%2008_31_21-100%25%20Inspection%20(Edit)%20Microsoft%20Forms%20%E2%80%94%20Mozilla%20Firefox.png%22%20alt%3D%22What%20my%20questions%20look%20like%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EWhat%20my%20questions%20look%20like%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EThe%20way%20the%20data%20submitted%20into%20a%20SharePoint%20list%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22This%20is%20data%20submitted%20into%20SharePoint%22%20style%3D%22width%3A%20330px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F335344i1E6E6831ECAE477D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222021-12-21%2008_30_27-Quality%20Information%20-%20100%25%20Inspection%20-%20All%20Items%20%E2%80%94%20Mozilla%20Firefox.png%22%20alt%3D%22This%20is%20data%20submitted%20into%20SharePoint%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EThis%20is%20data%20submitted%20into%20SharePoint%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3ERaw%20input%20in%20Flow%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Here%20is%20the%20raw%20input%22%20style%3D%22width%3A%20326px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F335345iCF29DE8570B5B7B7%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222021-12-21%2008_34_37-Run%20History%20_%20Power%20Automate%20%E2%80%94%20Mozilla%20Firefox.png%22%20alt%3D%22Here%20is%20the%20raw%20input%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHere%20is%20the%20raw%20input%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20ideas%20whats%20causing%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3043549%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EForms%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Forms%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3046278%22%20slang%3D%22en-US%22%3ERe%3A%20Some%20Form%20questions%20are%20getting%20brackets%20%5B%20%5D%20around%20answers%2C%20%5Cn%20at%20the%20end%2C%20and%2For%20%3CBR%20%2F%3E%20at%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3046278%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F174092%22%20target%3D%22_blank%22%3E%40RobElliott%3C%2FA%3Eare%20you%20still%20planning%20on%20following%20up%20with%20another%20post%3F%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3043606%22%20slang%3D%22en-US%22%3ERe%3A%20Some%20Form%20questions%20are%20getting%20brackets%20%5B%20%5D%20around%20answers%2C%20%5Cn%20at%20the%20end%2C%20and%2For%20%3CBR%20%2F%3E%20at%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3043606%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1256534%22%20target%3D%22_blank%22%3E%40src2021%3C%2FA%3E%26nbsp%3Bthat's%20how%20the%20flow%20in%20Power%20Automate%20deals%20with%20multi-choice%20answers%20from%20the%20form.%20I'll%20post%20up%20the%20way%20to%20deal%20with%20that%20asap.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERob%3CBR%20%2F%3ELos%20Gallardos%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%20color%3D%22%23006400%22%3EMicrosoft%20Power%20Automate%20Community%20Super%20User%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I have Form that triggers a flow when submitted. That flow puts the Form data into a SharePoint list. There's a couple questions on the form that consistently get brackets ["answer"] around the answer and sometimes the same question will have the brackets and a \n at the end like ["answer\n"]. There's another question that inconsistently gets a <br> put at the end of the answer answer<br>. I've tried deleting the questions with the problem(s) and re-creating them, but the issue persists. The problem seems to lie within Forms and not Flow or SharePoint because when I check the response details within Forms I see answers getting the extra stuff it shouldn't get. Here's some screenshots:

Question and answers in Forms:

What my questions look likeWhat my questions look like

 

The way the data submitted into a SharePoint list:

This is data submitted into SharePointThis is data submitted into SharePoint

 

Raw input in Flow:

Here is the raw inputHere is the raw input

 

Any ideas whats causing this?

3 Replies

@src2021 that's how the flow in Power Automate deals with multi-choice answers from the form. I'll post up the way to deal with that asap.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

@RobElliottare you still planning on following up with another post? :)

best response confirmed by src2021 (New Contributor)
Solution

@src2021 My apologies for the delay, I got horribly tied up last week with testing & delivering a Power Apps app before our company closed for Christmas.

 

In this example our form is as follows and allows the user to register for 1 or more events:
0-Form.png

 

As normal in the flow, start with the Forms "when a new response is submitted" trigger and the "get response details" action. 

 

1-Flow.png

 

Save it at this point and run it. You will need to get the id of the question where you were asking the multi-choice question in the form. Copy that ID.

 

1a-Flow.png

 

Next, add a Compose action and in the expression tab enter the expression below, changing my question  ID to your one that you've just copied. The expression will strip out the brackets and quotes and replace them with nothing:

 

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

2-Flow.png

 

Then you can just create the item in your list, using the outputs of the compose above:

3-Flow.png

 And this is the result.4-SP-list.png

 

Come back with any questions about this.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User