Does anybody know how to get the encodeHtml function to work on user input to an Html expression when using the Send Email Activity.
The help example shows: The following expression safely embeds user input as part of an Html expression. =`<div><h1>Field Notes</h1><p>${encodeHtml(userInput)}</p></div>`
But I cannot figure out how to format it to use $getWorkflowInputs1.inputs.userInput. Everything I have tried returns an error "The given expression could not be evaluated, Object has no method 'encodeHtml'"
0
-
Hi Shaunda,
Could you share the expression that you are using? It sounds like you have ".encodeHtml(" after something else, rather than using it directly.
The expression should be something like this:
=`<div><h1>Field Notes</h1><p>${encodeHtml($getWorkflowInputs1.inputs.userInput)}</p></div>`Key things to note in the above:
- The string is surrounded by backticks, not single or double quotes. This allows us to use ${ } to put a script directly within the text.
- The encodeHtml() function is called directly, in other words it is not contained within an object.
- The html surrounding the ${ } block is just for illustration and can be changed to whatever you want.
0 -
Where can I find documentation on encodeHtml? This does not seem to be a valid function.
0
Please sign in to leave a comment.
Comments
2 comments