Forum Discussion
Logic app search replace function usage example?
I'm using html in the sentinel 'add comments' operator and I'm seeing lots of \n characters.
I want to remove them all so they don't write line feeds to the output and mess up my html markup.
Thank you.
hi SocInABox
Not sure if it's the same, but, I've feced something similar with an HTML table where I wanted to include a hyper link using <a href> and Logic App replaced those chars.
What I did was process the HTML content before using it (Send Email) as an expression
replace(replace(variables('email_html'), '<', '<'), '>', '>')Maybe my scenario is simplier than the one you have but hope it helps
- cmaneiroMicrosoft
hi SocInABox
Not sure if it's the same, but, I've feced something similar with an HTML table where I wanted to include a hyper link using <a href> and Logic App replaced those chars.
What I did was process the HTML content before using it (Send Email) as an expression
replace(replace(variables('email_html'), '<', '<'), '>', '>')Maybe my scenario is simplier than the one you have but hope it helps- SocInABoxIron Contributor
Hey cmaneiro, thanks! that worked for me.
Took me a minute to realize your example was a 'replace inside of a replace', which was more than i needed.
I was able to replace all of the html content containing '\n' with '' ('' = nothing).
So my solution was:
- collect all variables (which contain html markup) and assign them all to a single variable.
- replace all \n values with nothing.
- use the cleaned up variable in my Sentinel Incident comments.
The result is a much better formatted html with only one line feed between the text body and the table (before there were 8 linefeeds!)
- cmaneiroMicrosoft
- raffellisCopper Contributor
- raffellisCopper ContributorI have a large document that is riddled with paragraph symbols in the wrong place