- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
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 :
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 :
var htmlString = fd_data.flow_var.accountnametocreate;
var plainText = htmlString.replace(/<[^>]+>/g,'');
return plainText.trim();
Output -
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
- 1,764 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.