The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How to get/fetch instance name dynamically in an email template script?

Balaraju K B
Tera Expert

Hi All,

I have a script in the email template for the Catalog approval request Notification in this email template How I can fetch instance name dynamically. Please find the below image for the script.

After 'href=' I want to fetch instance name

find_real_file.png

@Ankur Bawiskar Any idea on this?

 

Thank you,

Bala

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

no need of instance name

when you give relative URL using / then it would automatically take user to that record in the instance.

Regards
Ankur

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

relative links are best practice but will only work when you are already in the instance. In a mail notification you will need to add the full url or it wont work.

Hi,

you can use email script and get the instance name using this

var instanceName = gs.getProperty('instance_name');

Regards
Ankur

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

@Balaraju K B 

you need to use email script and include line I mentioned above

Regards
Ankur

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