Amit Verma
Kilo Patron
Kilo Patron

This post will be helpful to those who are looking out to remove HTML tags and convert it to String variable within the Flow Designer. The Replace String transformation function doesn't works well with the HTML variable so if you are facing issue with the Replace String transformation function or you are looking out a way to replace HTML tags from a HTML variable, this blog is for you.

 

Suppose I have a Flow Variable which holds the HTML as shown below :

 

AmitVerma_0-1727242060302.png

Here, we want to extract just the account name from the HTML to create the account for the user. To extract this username, we can make use of a regex to replace the HTML tags with a null as shown below :

AmitVerma_2-1727242333387.png

 

var htmlString = fd_data.flow_var.accountnametocreate;
var plainText = htmlString.replace(/<[^>]+>/g,'');
return plainText.trim();

 

 

Output -

 

AmitVerma_3-1727242489243.png

 

With this above logic, you will get a string free from HTML tags and whitespaces. You can now use it to create the account in the subsequent actions.

 

#flowdesigner #transformationfunction