web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Remove HTML tags from ...
Power Automate
Unanswered

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>','')



Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

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

    image.png

  • Community Power Platform Member Profile Picture
    on at

    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?




  • Verified answer
    Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    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.

  • sorintdr Profile Picture
    2 on at

    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);

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at
    There is no support for REGEX in Power Automate. Its only available at this point in Power Apps.
  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at
    There is no support for REGEX in Power Automate. Its only available at this point in Power Apps.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard