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> </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> </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)
After all of that, I use a select action to select the properties that I want to show in the final report
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>','')
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);
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.
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?
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?
There is an action that will strip the HTML tags out of a string and return just the text.
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1