itpro72
Tera Contributor

Following are instructions for a custom action to create a hyperlink in Flow Designer. In this case I'm creating a hyperlink to a table record but I'll follow up with a description of a custom action to create an external hyperlink.

 

The action inputs:

LabelType
tableNamestring
recordSysIdstring
linkDisplayName  string

 

The "Generate Link" script:
(function execute(inputs, outputs) {
var linkJournal="[code] " + "<a href=\"" + inputs['tableName'] + ".do?sys_id=" + inputs['recordSysId'] + "\" target=\"_blank\">" + inputs['linkDisplayName'] + "</a>" + " [/code]";
outputs['linkJournal']=linkJournal
var linkHTML="<a href=\"" + inputs['tableName'] + ".do?sys_id=" + inputs['recordSysId'] + "\" target=\"_blank\">" + inputs['linkDisplayName'] + "</a>";
outputs['linkHTML']=linkHTML
})(inputs, outputs);

 

The action outputs:

LabelValue
linkHTMLstep > Generate Link > linkHTML
linkJournal  step > Generate Link > linkJournal

 

Then when using the action in a flow, drag and drop a lookup record's attributes into the appropriate fields (Incident Table for the first input, Incident Record > Sys ID for the second, then Incident Record > Number for the third input).

The reasoning behind the two outputs is that journal fields require the [code][/code] around the html. (See Formatting within Journal fields using HTML & [code])

 

For an external hyperlink you only need two inputs, one for the URL and one for the text to display. Then the script is modified to construct the hyperlink appropriately.

 

I hope you find this helpful.

Daniel

Comments
jmk_mcc
Tera Expert

Very helpful!  It almost works for us 🙂 - we seem to pick up some "garbage" from the datapill, ours picks up something, I think its the first "TASK...." anything you've seen before, and how to correct?

find_real_file.png

<p><p>&nbsp;Your group has been assigned&nbsp;<span class="data_parent_pill" style="display: inline;" contenteditable="false" data-pillid="2e0d80ad-46aa-4bec-8ca9-d89a669945bd" data-pillvalue="<a href="sc_task.do?sys_id=6f63d161db02cc501233341f9d9619ce" target="_blank">TASK0060435</a>"><a href="sc_task.do?sys_id=6f63d161db02cc501233341f9d9619ce" target="_blank">TASK0060435</a></span>- see description below.</p>
<p>&nbsp;<span class="data_parent_pill" style="display: inline;" contenteditable="false" data-pillid="2acbe028-5ae3-4197-824d-2fa0d70e5b04" data-pillvalue="abc 123">abc 123</span></p>
<p>&nbsp;</p></p>
David Pleasance
Kilo Contributor

Did you ever follow up with a description of a custom action to create an external hyperlink?

danielbartholom
Mega Expert

Hi @itpro72 (Daniel),

I was wondering if you could help me please. I am struggling a little on the Action Outputs. Could you kindly provide the steps and/or screenshot of what this should look like? I am unable to find the value column

 

Regards

 

Daniel

rajamma
Tera Contributor

Hi @itpro72 

 

I have tried with all steps but i am unable to generate link

Could you please help me on this.

Thanks In Advance.

rajamma_0-1679389829389.pngrajamma_1-1679389849284.pngrajamma_2-1679389863689.png

rajamma_3-1679389890464.png

 

 

Regards

Panga Rajamma

 

Version history
Last update:
‎10-23-2019 01:16 PM
Updated by: