for Microsoft Power Automate and Azure logic apps

By Jay Goodison

21st September 2023

Escape and Unescape HTML in Power Automate

Post #10 of our Build Flows Faster series covers our new Utility actions for Power Automate. We will publish many more posts and accompanying videos over the coming weeks, but today’s lesson is about escaping (encoding) and unescaping (decoding) HTML in Power Automate

Our utility actions are targeted at helping you build flows more quickly with less complexity, and they brilliantly only use 0.05 actions from your Encodian Flowr and Vertr subscription allowance. For example, under a standard plan that permits 500 actions per month (uses), you could use the utility actions 10,000 times!

Introducing the ‘Escape HTML’ and ‘Unescape HTML’ Utility Actions

The ‘Escape HTML‘ utility action escapes (encodes) the HTML provided and (you guessed it!) the ‘Unescape HTML‘ utility action (decodes) unescapes the HTML provided!

Video Guide: Escape and Unescape HTML in Power Automate

Instructions: Escape and Unescape HTML in Power Automate

Given there are myriad of scenarios which would require HTML to be escaped (encoded) and unescaped (decoded), we’ll focus on how the ‘Escape HTML‘ utility action and ‘Unescape HTML‘ utility action work as opposed to covering specific scenarios.

Encode HTML with the Encodian ‘Escape HTML’ utility action

Consider the following basic manually triggered flow, which we’ll add the ‘Utility – Escape HTML‘ utility action to:

Lets update the flow to escape (encode) the HTML provided and return to the user within an email:

1. Add the ‘Utility – Escape HTML‘ utility action to the flow

1.b. HTML: Select the ‘HTML‘ property provided by the trigger action

2. Add the ‘Send an email notification (V3)‘ action

2.a. To: Select the ‘User Email‘ property provided by the trigger action

2.b. Subject: Enter an appropriate subject for the email

2.c. Body: Enter required message detail and then select the ‘Result‘ property provided by Encodian ‘Utility – Escape HTML‘ utility action

All done and ready for testing!  The following HTML;

<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>

Generates the following output:

And the following email:

Decode HTML with the Encodian ‘Unescape HTML’ utility action

Consider the following basic manually triggered flow, which we’ll add the ‘Utility – Unescape HTML‘ utility action to:

Lets update the flow to unescape (decode) the HTML and return to the user within an email:

1. Add the ‘Utility – Unescape HTML‘ utility action to the flow

1.b. HTML: Select the ‘Encoded HTML‘ property provided by the trigger action

2. Add the ‘Send an email notification (V3)‘ action

2.a. To: Select the ‘User Email‘ property provided by the trigger action

2.b. Subject: Enter an appropriate subject for the email

2.c. Body: Enter required message detail and then select the ‘Result‘ property provided by Encodian ‘Utility – Unescape HTML‘ utility action

All done and ready for testing!  The following escaped (encoded) HTML;

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;body&gt;
&lt;h1&gt;My First Heading&lt;/h1&gt;
&lt;p&gt;My first paragraph.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;

Generates the following output:

And the following email:

If you require further advice or support regarding Encodian utility actions, please email our support team at support@encodian.com where the team would be delighted to help.