cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Resolver II
Resolver II

Line Break in Sharepoint causes flow to fail

hello Community,

 

I have a flow where 

 

1. User uses PowerApps to submit a form where the data of the form is stored in SharePoint

2. When a new row is generated, the flow kicks in and start

3. the flow then takes all the info from the generated row in SharePoint and convert into JSON 

4. Then JSON info then gets send to a website through API

 

The issue:

 

I have noticed whenever if someone submits the form through PowerApps, that has a line-break, 

 

for example - in one description box of the form, if I type: 

"Test

test"

 

then the flow will fail in the at the point reaching to http and says "bad request". 

 

I know the problem is I will need to switch the <br> into a string in JSON that also does the line-break but I don't how in the flow, I will make the flow read the content of the column data from share point, and whenever there is a line-break, concert into JSON accordingly. 

 

Any guidance is highly appreciated, thank you! 

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi again

I've just tested the NEw Line old trick, it still works. Plase note I have added a 'Compose NewLine' action block, and just hit the Enter button.

Hope this helps

 

Flow_NewLine.png



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

@efialttes  Thank you for your advice! I took your idea and tried it but it still failed at the http level. But then, I kept the idea of using 'compose data' as the first step to grab the data from sharepoint. Then have another 'compose data' again with an empty line break in there (so just press enter in the chat box". 

 

Then, I added another step, which is 'initiate a variable' then I use the replace function within that variable and set the variable into string. Then after parsing it into JSON, the API accepts the JSON again! 

 

Thanks a lot! 

View solution in original post

4 REPLIES 4
Dual Super User III
Dual Super User III

Hi!
I think you can remove new lines by means of a replace() based expression
https://powerusers.microsoft.com/t5/Using-Flows/replacing-newline/td-p/44961
Please note this post is a bit old, I assume you will add the expression via dynamic content menu, so you should not add @
Hope this helps


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Hi again

I've just tested the NEw Line old trick, it still works. Plase note I have added a 'Compose NewLine' action block, and just hit the Enter button.

Hope this helps

 

Flow_NewLine.png



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

@efialttes  Thank you for your advice! I took your idea and tried it but it still failed at the http level. But then, I kept the idea of using 'compose data' as the first step to grab the data from sharepoint. Then have another 'compose data' again with an empty line break in there (so just press enter in the chat box". 

 

Then, I added another step, which is 'initiate a variable' then I use the replace function within that variable and set the variable into string. Then after parsing it into JSON, the API accepts the JSON again! 

 

Thanks a lot! 

View solution in original post

@lliu_western 

Glad it helped!

Please note I've marked your last post also as a solution since you invested time describing the way you adapted your technique to your specific scenario, and I think it can be extremely useful for other community members facing this same issue in the future.

Thanx for your making this community better!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (7,760)