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 add hyperlink to dynamic number in email script

indrasengupta
Tera Guru

i have "${sysapproval.URI}" link & i want it to be hyperlink to dynamic number "${sysapproval.number}" how can i do it,
i tried

 

template.print('<tr><td>' + "Number: " + '&nbsp; &nbsp;</td><td>' + '<a href=' + '${sysapproval.URI}' + '>' + '${sysapproval.number}' + '<a/>' + '</td></tr>');

 

but not working

indrasengupta_0-1714413461444.png

 

1 ACCEPTED SOLUTION

indrasengupta
Tera Guru

by using following i was able to do it.

template.print('<tr><td>' + 'Number:' + '&nbsp; &nbsp;</td><td>' + '${sysapproval.URI_REF}' + '</td></tr>');

https://docs.servicenow.com/bundle/vancouver-platform-administration/page/administer/notification/co...

indrasengupta_0-1714474250904.png

 

View solution in original post

4 REPLIES 4

Seraj
Tera Guru

Hi @indrasengupta 

Try this

You can change your table as per your requirement

var link= '<a href='+'your_instance_name/incident.do?sys_id=' +current.sys_id+'>'+current.number+ '</a>' ;
		  template.print(link);

I have used the above, it's working as expected. Thanks!

indrasengupta
Tera Guru

by using following i was able to do it.

template.print('<tr><td>' + 'Number:' + '&nbsp; &nbsp;</td><td>' + '${sysapproval.URI_REF}' + '</td></tr>');

https://docs.servicenow.com/bundle/vancouver-platform-administration/page/administer/notification/co...

indrasengupta_0-1714474250904.png