diff --git a/Flow Actions/Extract JSON Key without Flow Transformation/readme.md b/Flow Actions/Extract JSON Key without Flow Transformation/readme.md new file mode 100644 index 0000000000..4bd2e4cd0b --- /dev/null +++ b/Flow Actions/Extract JSON Key without Flow Transformation/readme.md @@ -0,0 +1,3 @@ +This code 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 to overcome this challenge, we can make use of a Run Script Flow action along with a regex and JavaScript replace method. + +The function expects the input HTML string to be passed into and we get a string free from HTML tags and whitespaces as an output. diff --git a/Flow Actions/Extract JSON Key without Flow Transformation/remove-html-tags.js b/Flow Actions/Extract JSON Key without Flow Transformation/remove-html-tags.js new file mode 100644 index 0000000000..2171dd747f --- /dev/null +++ b/Flow Actions/Extract JSON Key without Flow Transformation/remove-html-tags.js @@ -0,0 +1,5 @@ +(function execute(inputs, outputs) { +var htmlString = inputs.htmlValue; // Assuming HTML string is stored in the input variable htmlValue +var plainText = htmlString.replace(/<[^>]+>/g,''); // Regex to replace HTML tags +outputs.plainString = plainText.trim(); // Trimming the whitespaces, if any and pushing the string without HTML to output variable plainString +})(inputs, outputs); diff --git a/Flow Actions/Remove HTML Tags from a String in a Flow b/Flow Actions/Remove HTML Tags from a String in a Flow new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/Flow Actions/Remove HTML Tags from a String in a Flow @@ -0,0 +1 @@ +