How to add link to RITM in Flow Designer send mail?

Radhika11
Tera Contributor

Hello,

Is is possible to add a link to the RITM in flow designer send mail body area?  Thanks

find_real_file.png

5 REPLIES 5

Luke Van Epen
Tera Guru

Per the docs:

Note: Flow Designer does not support the ${URI} parameter in the email message body. To create a link to a record, use data pills, or create a notification step instead.

 

So yes you can, but you need to manually construct the URL using the data pills as reference

However like the docs suggest, it will probably be easier to use the Send Notification action instead of Send Email.

Docs link: https://docs.servicenow.com/bundle/rome-servicenow-platform/page/administer/flow-designer/reference/...

Thank you so much for your suggestion Luke!

I'm familiar with the Send Notification action, but also wanted to learn how to do it in Flow Designer, send email action. 

Do you have an example how to manually construct the URL using the data pills so that I can learn from it?

 

Aishwarya_R
Tera Contributor

Hi @Radhika11 

Best way to add a link to the RITM in send mail action in flow designer. Try following steps:

add URL in flow.png

Toggle scripting on for body (marked in attachment).
Then write below code:

var sysId = fd_data.trigger.request_item.sys_id;
var num= fd_data.trigger.request_item.number;

var text = "write your text here <br/><br/>Number: ";
 
var url = "https://Add your URL here/sp?sys_id="+ sysId +"&view=sp&id=ticket&table=sc_req_item";

var url_final = '<a href = "'+url+'">'+ num +'</a>';

return text + url_final ;


Please accept the solution & mark helpful if it works for you.

 

Regards,
Aishwarya

Do you think it is possible to write this as a reusable Custom Action, that returns link to the RITM, regardless of which environment it is found in (Dev, Test, Prd)?  I don't want to hard-code the environment so the Custom Action will work in any of our environments.