As far as I know Power Automate is unable to Rich text Content Controls in MS Word. When I use just a Plain Text Content Control, it add a bunch of HTML tags, such as <div> and <p>, etc. I saw somewhere (can't recall where) that a workaround is to use a Repeating Section Content Control by creating an array. For example, I have data that look like this:
<div class="ExternalClassB8D4B82FCC774E82A9AA0B1B2EE583E1"><p>This is a paragraph. Very nice!</p><p>Another paragraph, great</p><p>Even more paragraphs</p><p>The end is here</p></div>
I started playing around using a Compose and split() with <p> as the separator, but the results look pretty bad:
[
"<div class=\"ExternalClassB8D4B82FCC774E82A9AA0B1B2EE583E1\">",
"This is a paragraph. very nice!</p>",
"Another paragraph, great</p>",
"Even more paragraphs</p>",
"The end is here</p></div>"
]
How can I just extract just the text that is between <p> and </p>, and remove all the rest?
Thanks in advance.
Solved! Go to Solution.
I think I figured out combining a bunch of Split, and Replace.
split(replace(replace(last(split(outputs('Get_item')?['body/Location_Text'], '">')), '</div>',''), '</p>',''), '<p>')
//Result --//
[
"",
"First Paragraph,",
"Second Paragraph,",
"Third Paragraph"
]
I think I figured out combining a bunch of Split, and Replace.
split(replace(replace(last(split(outputs('Get_item')?['body/Location_Text'], '">')), '</div>',''), '</p>',''), '<p>')
//Result --//
[
"",
"First Paragraph,",
"Second Paragraph,",
"Third Paragraph"
]