How to remove HTML and XML from a string in PowerApps Canvas apps

Follow Debajit’s Power Apps & Dynamics 365 Blog on WordPress.com

This is fairly simple one especially after my last blog. But I bet this may be more required than what I wrote for my previous blog.

In this blog I am going to discuss the following

  • How to remove HTML tags from a string in Canvas apps?
  • How to remove XML tags from a string in Canvas Apps?

While this is fairly simple, I came across implementations where custom string manipulation function is written to remove the HTML and XML tags. In-fact there is a function available in PowerApps which does just that. And that function is PlainText.

So let’s see the PlainText function in action.

remove HTML from string in canvas app

As you can see in the above screenshot, I am using the PlainText function to strip all HTML characters and covert it into a simple string. Quite wonderful isn’t it?

The function also does HTML decoding. In the below example, not only HTML characters are stripped, even the HTML encoded characters like " and   are decoded.

remove HTML from string in canvas app
remove HTML from string in canvas app

Not only HTML characters, it even takes care of removing the XML tags from a string.

remove HTML from string in canvas app

Quite interesting. If you try to do it using string manipulation, then it’s quite a task. And these are the kind of functions I believe which truly stands by low code no code concept.

Hope this helped!

You may also like the below posts

Debajit Dutta
Business Solutions MVP