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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (4,454)