Crow Canyon Software Forum

Forum Navigation
Please or Register to create posts and topics.

Injecting HTML into a Multiline Text Field

Hi everyone. We recently came across a use case for injecting multiline HTML into a Multiple Lines of Text field. At first, this seemed a little daunting, but it's actually quite easy to set up.

To set HTML in a Multiline text field using Custom Actions (or Workflows, for that matter), you can use the Update Item action and use the $strcat function. Use this in conjunction with variables. For instance, since parentheses, commas, and other special characters are used within functions themselves, you'll want to define these as variables. See the attached image for using variables for the "comma" character and the "<br/>" (line break) character.

Then you can build your string in the column mapping section using something like this:

$strcat([LastName|LastName],varcomma##Value, ,[FirstName|FirstName],varnewline##Value,[Phone|Phone])
So you can use "varnewline##value" for the line break and "varcomma##value" for the comma. Use the same construct for any other variables you define.
Try it out and let me know your comments below!
Uploaded files:
  • MicrosoftTeams-image.png
bob has reacted to this post.
bob
Quote from James Restivo on March 9, 2021, 10:57 am

Hi everyone. We recently came across a use case for injecting multiline HTML into a Multiple Lines of Text field. At first, this seemed a little daunting, but it's actually quite easy to set up.

To set HTML in a Multiline text field using Custom Actions (or Workflows, for that matter), you can use the Update Item action and use the $strcat function. Use this in conjunction with variables. For instance, since parentheses, commas, and other special characters are used within functions themselves, you'll want to define these as variables. See the attached image for using variables for the "comma" character and the "<br/>" (line break) character.

Then you can build your string in the column mapping section using something like this:

$strcat([LastName|LastName],varcomma##Value, ,[FirstName|FirstName],varnewline##Value,[Phone|Phone])
So you can use "varnewline##value" for the line break and "varcomma##value" for the comma. Use the same construct for any other variables you define.
Try it out and let me know your comments below!

I'm trying this process out to build a web service URL, but it's not processing commas, parenthesis, or quotes. Here's what I have:

 

Uploaded files:
  • variables.PNG

I did find that the order of variables makes a difference. I had my $strcat variable defined before my special character variables and it didn't like it. Now I've moved it and the commas and quotes are working but not the two parenthesis. But I'm tracking that down in another post.

Workflow – Build string action – Crow Canyon Software Forum – Crow Canyon Software Support