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 insert hyperlinks, HTML code, etc. via Flow Designer?

davida1
Giga Expert

I'm trying to create a function via Flow Designer such that an incident is generated when something (a group, in this case) expires. Our homegrown group maintenance system expires things after a year, and in spite of numerous (9) notices, group owners/managers still let their groups expire. To mitigate this, we decided to load the expiration date into the Groups table, and have a flow trigger when that date passes. It generates an incident assigned to the expired group, with information on what to do whether they wish to keep it (likely) or not. 

I ran into a snag when I tried inserting into the 'Additional comments' field a hyperlink to the knowledge base article on using the homegrown system. No matter how I enter the URL code, it's partially erased either when I hit 'Enter' or when I click 'Save' on the flow. A URL that looks like:

<a href="https://umd.service-now.com/itsc?id=kb_article&article=KB0011206">

turns into this:

<a href="https://umd.service-now.com/itsc?id

I've tried following tips from "Formatting within Journal fields using HTML & [code]" (https://community.servicenow.com/community?id=community_blog&sys_id=4d9ceae1dbd0dbc01dcaf3231f9619e1). I've got an open incident with HI, but other than direct me to the page above they're still looking into it.

I can put hyperlinks into 'Additional comments' directly, but not via Flow Designer. Anyone had any better luck?

David A
davida@umd.edu

16 REPLIES 16

davida1
Giga Expert

Here is the code I finally came up with; wrapping HTML in [code] tags was the key:

find_real_file.png

This is the resulting text:

find_real_file.png

I hope this is helpful,

David

Kamal12
Tera Contributor
This is not Working anymore. Any idea?

Kamal12
Tera Contributor
Hello David, This will work only when system property glide.ui.security.allow_codetag is enabled. Otherwise it wouldn't work.

Humayun Ansari
Kilo Contributor

I had a requirement to send multiple emails with each one has dynamic link to different applications of cmdb_ci_appl table.

 

The process I followed

1. Lookup Records (Action) Gives multiple records

2. For Each (Flow Logic) Iterate all records one by one

3. Send Email (Action) HTML content 

In html I used hyperlink and added sys_id of configuration items which I received from 'for each' record 

<a href="cmdb_ci_appl.do?sys_id={{fd_transform:17be0093-6eee-4114-8090-5d1ba29f37a2}}">Take me to the Application</a>

 

{{fd_transform:17be0093-6eee-4114-8090-5d1ba29f37a2}} -> This part you can get from data pill

find_real_file.png

 

find_real_file.png

This line of data pill returns html code like this 

<span class="data_parent_pill" style="display: inline;" contenteditable="false" data-pillvalue="{{fd_transform:17be0093-6eee-4114-8090-5d1ba29f37a2}}"><span class="data_pill  accepts_transform_functions" contenteditable="false" data-pillvalue="{{fd_transform:17be0093-6eee-4114-8090-5d1ba29f37a2}}">5âž›Certification Element Recordâž›Configuration itemâž›Sys ID<button id="transform_function_facade_17be0093-6eee-4114-8090-5d1ba29f37a2" class="transform_function_facade no_transform_applied"><span class="inline-script-icon"><span style="display: none;">​</span></span></button></span></span>

 

Take the data-pillvalue which is {{fd_transform:17be0093-6eee-4114-8090-5d1ba29f37a2}} and put it in the hyper link

Thanks, this solved my problem generating a link to a serviceportal knowledge article. 🙂