Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to map data to an HTML field?

Raghav Kakkar
Tera Expert

Hello All,

 

We have an OOB integration where we map the raw data to the form fields. I need to map 3-4 URLs to a field of type HTML. The idea is to have a hyperlink for the URLs rather than plain text that needs to be copied.

 

Assume that the raw URLs are https://url1.com, https://url2.com, https://url3.com, etc. but these are in variables which if we need to map using the OOB UI, will look like ${url1}$, ${url2}$, ${url3}$, etc.

 

When I try to directly use these variables to map to the HTML field, these variables act as string values and then get HTML encoded.

 

What I want on the field should look like:

URL 1:  https://url1.com

URL2: https://url2.com

URL3: https://url3.com,

 

I tried to parse the data as HTML:

varURL her is the raw variable put into a JavaScript variable that will hold a URL.

<p>URL 1: <a href="'+varURL1 + '" target="_blank">' varURL1 '</a></p><br><p>URL 2: <a href="'+varURL2+ '" target="_blank">' +varURL2 +'</a></p>

Though, this doesn't seem to work either.

 

Any help is appreciated! 

0 REPLIES 0