How to get URL of a record from flow designer?

Meghant Rai
Kilo Guru

I have a requirement where I have to mention the incident number in worknotes/Additional comments section in form of Hyperlink.

I can do it via [code]<a href="https://www.servicenow.com">ServiceNow.com</a>[/code], but the question is how can I get the URL of the incident. 

There are no data pills available to fetch URL of incident to re-direct on click.

1 ACCEPTED SOLUTION

Hi,

so what is pending?

you can get current record sys_id inside the f(x) script like this

var sysId = fd_data.trigger.current.sys_id;

That would help you form the URL to the record

like this; it would add link to current record on which flow is running

var tableName = fd_data.trigger.current.sys_class_name;

var sysId = fd_data.trigger.current.sys_id;

var url = '[code]<a href="' + gs.getProperty('glide.servlet.uri') + '/nav_to.do?uri=' + tableName + '.do?sys_id=' + sysId + '">' + 'My Record' + '</a>[/code]';

return url;

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

12 REPLIES 12

Maik Skoddow
Tera Patron
Tera Patron

Hi @Meghant Rai 

please see https://community.servicenow.com/community?id=community_article&sys_id=463c05ef1b665010d2ccea89bd4bc... or https://community.servicenow.com/community?id=community_question&sys_id=e0c805e7dbfbd34067a72926ca96... for a solution.

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

where are you using this script?

Can you share some more details around this?

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Ankur Bawiskar : I am using this script in work notes.

If you paste  [code]<a href="https://www.servicenow.com">ServiceNow.com</a>[/code] in work notes section if will create a hyperlink.

 

I am trying to incorporate the same using update record action in flow designer to update the work notes 

Hi,

so what is pending?

you can get current record sys_id inside the f(x) script like this

var sysId = fd_data.trigger.current.sys_id;

That would help you form the URL to the record

like this; it would add link to current record on which flow is running

var tableName = fd_data.trigger.current.sys_class_name;

var sysId = fd_data.trigger.current.sys_id;

var url = '[code]<a href="' + gs.getProperty('glide.servlet.uri') + '/nav_to.do?uri=' + tableName + '.do?sys_id=' + sysId + '">' + 'My Record' + '</a>[/code]';

return url;

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader