Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Remove HTML tags from json response

(0) ShareShare
ReportReport
Posted on by

Hi, I'm building a flow that receives a json collection from an external API. In this json collection there is a property which corresponding value always contains html tags and I don't want those tags to be shown in my final report (the flow will generate a html table in an outlook mail as a report)

This is an example of the property in the json collection

 

"permissions": [],
"isAutoAssigned": true,
"ticket": {
 "description": "<p> Need address confirmation for Hong Kong region </p><html> <head> </head> 
 <body> <p> Hi Team, </p> <p> &nbsp; </p><p> Please be informed that we have received a 
 notification about Hong Kong invoice getting billed with incorrect banking address(attached 
 is the copy of invoice for your reference), below is the confirmation form treasury that the 
 banking address in attached supplier sheet is the correct one , request you to make necessary 
 changes to fix the address on invoice copies revert at the earliest. </p> <p> &nbsp; </p> 
 "location": {

 


This how I'm getting the json, using a HTTP post request, after that I parse the json and the I use a filter array action to filter the json array (I don't want all the json objects)

JosueViq_0-1685632795903.png


After all of that, I use a select action to select the properties that I want to show in the final report

JosueViq_1-1685632893777.png


Is there any way to remove the html tags from the "description" json property? 

I already try doing something like this in the select action but is not working form me

replace(replace(replace(string(body('inProgress_tickets_array')),'<p>',''),'</p>',''),'<html>','')



  • Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Remove HTML tags from json response
    There is no support for REGEX in Power Automate. Its only available at this point in Power Apps.
  • Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Remove HTML tags from json response
    There is no support for REGEX in Power Automate. Its only available at this point in Power Apps.
  • sorintdr Profile Picture
    2 on at
    Re: Remove HTML tags from json response

    Regex is the best right choise to achive this task. Because I'm a C# programmer, we could do this by generalizing like this:

    string ClearHtmlTags(string source) => new Regex("<[^>]*>").Replace(source, string.Empty);

  • Verified answer
    Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Remove HTML tags from json response

    Since there is no function version of the action you'll need to actually do an apply to each on the collection instead of the Select. Then in the loop use the HTML to text action to remove the HTML tags from that property of the current item and then append the fields that you want to an array variable to recreate the array with the html tags removed.

  • Community Power Platform Member Profile Picture
    on at
    Re: Remove HTML tags from json response

    Hi @Pstork1 thanks for the response

    How can I apply this action for my case?

    I'm trying to do this, but after that, how can apply the change in the original array?

    JosueViq_0-1685635785856.png


    It definitely clean the html tags but the change is not saved in the filtered array and final report, do you know how can I approach that?




  • Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Remove HTML tags from json response

    There is an action that will strip the HTML tags out of a string and return just the text.

    image.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1