cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
doubles
Advocate I
Advocate I

HTML to text -- \n throughout output

I am trying to build a flow that takes SQL data and puts it in a text file that is saved on sharepoint. After a lot of experimenting, I settled on using the HTML table data operator, as it maintains the formatting I need in teh text file, with one exception. The HTML to text step inserts \n throughout the output of that step, causing line breaks throughout the file that did not previously exist in the data. Is there a way to prevent this from happening?flow config.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @doubles ,

 

It seems that using an HTML table is not able to achieve your needs, you need to try other methods.

Please consider the method below to achieve your needs. Note that a blank line is added to Value.

212.PNG

Please take a try.

 

Best Regards,

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

View solution in original post

9 REPLIES 9
abm
Super User
Super User

Hi,

 

Could you try using the expression Replace to remove the \n values?



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

@abm  thank you for the reply. I did try replacing \n with '' and it did not work. This would also get rid of the line breaks I want to maintain between rows in the html table. In the HTML table step output, those line breaks are indicated by

</td></tr><tr><td>

 These are replaced by \n in the output of html to text (along with \n being interspersed throughout the output)

Hi @doubles 

 

Thanks for your quick reply.

 

Did you tried replacing the HTML elements before the HTML table to text step?

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

@abm thank you -- yes I can do that, however I want to maintain those line breaks. I did try it just to see what the Html to text step would do and it still intersperses \n about every 80 characters or so.

I think it probably has something to do with the line of code before the body in the output, but not sure if its possible to change these settings.

 

{"statusCode":200,"headers":{"Pragma":"no-cache","Transfer-Encoding":"chunked","Vary":"Accept-Encoding","Strict-Transport-Security":"max-age=31536000; includeSubDomains","X-Content-Type-Options":"nosniff","X-Frame-Options":"DENY","Timing-Allow-Origin":"*","x-ms-apihub-cached-response":"false","Cache-Control":"no-store, no-cache","Date":"Wed, 18 Dec 2019 19:03:04 GMT","Set-Cookie":"ARRAffinity=9227faf24135ad53dd065beee547fecb0ff01774dd3486105eba5bed7b415073;Path=/;HttpOnly;Domain=conversionservice-eus2.azconn-eus2.p.azurewebsites.net","Content-Type":"text/html; charset=utf-8","Expires":"-1","Content-Length":"292729"}

Hi @doubles 

 

This might help

 

https://powerusers.microsoft.com/t5/Using-Flows/Removing-blank-lines/td-p/283116

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Thanks, my data is too large to iterate through each record.

Hi @doubles 

 

Thanks for your reply. The challenge here is to change the default behaviour and keep other new lines. There is no unique elements to keep it separate. We need to think about any other ways without using HTML table to text for this solution.



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
v-bacao-msft
Community Support
Community Support

 

Hi @doubles ,

 

It seems that using an HTML table is not able to achieve your needs, you need to try other methods.

Please consider the method below to achieve your needs. Note that a blank line is added to Value.

212.PNG

Please take a try.

 

Best Regards,

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

Helpful resources

Announcements
Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (1,783)