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

Populate Word Template without with Rich Text SharePoint fields

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
emfuentes27
Resolver II
Resolver II

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"
]

View solution in original post

1 REPLY 1
emfuentes27
Resolver II
Resolver II

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"
]

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (2,927)