← Al Davies, 250 High Street

Power Automate: convert HTML to text

Add the Html to text action from the Content Conversion connector, put the HTML in its Content field, and use the plain text it returns. Microsoft's connector page points to string functions in expressions for any clean-up afterward.

How does the Html to text action work?

The action converts an HTML document to plain text. Its one required input is Content, the HTML document to convert, and it returns the plain text content as a string. Microsoft lists the connector as Standard class in Power Automate, and the connector page is marked Preview.

What does the output look like?

In the HTMLIn the text
A link such as <a href='link'>text</a>text[link]; only text if both are the same
Headers (h1, h2 and so on) and th cellsUppercased
An unordered listLines that start with *
Empty linesTrimmed
A line longer than 80 charactersA line break follows after 80

What are the limits?

Microsoft says unexpected line breaks, wrong formatting or missing hyperlinks are by design, because the connector does not keep the HTML formatting and removes hyperlinks. Its suggested workaround is to use string functions in expressions to replace content. Examples are in replacing text with replace() and trimming spaces from text.

Is there an expression instead?

Microsoft documents the Html to text action for this job, and its full function reference for expressions lists no function that strips HTML. To go the other way and build HTML, see formatting a Create HTML table.

FAQ

Does Html to text keep my links?

Not as clickable links. Microsoft's connector page says a link becomes its text followed by the address in square brackets.

Why is my text cut into short lines?

Microsoft says the maximum line length is 80 characters, after which a line break follows.

Is the Html to text action a premium connector?

Microsoft lists the Content Conversion connector as Standard class in Power Automate.

Sources