How to get/fetch instance name dynamically in an email template script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2022 03:29 AM
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
Thank you,
Bala
- Labels:
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2022 03:48 AM
you can use gs.getProperty('glide.servlet.uri') to get the uri of the instance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2022 03:49 AM
Hi,
gs.getProperty('instance_name') should work in the template script.
Regards Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2022 03:50 AM
instance name + service-now.com will work 99% of the time but some instance have a custom uri. The glide.servlet.uri will also provide the correct uri in those cases.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2022 12:38 AM
I agree, but that was not the question asked 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2022 04:56 AM
if I use directly it is not working using the above line in an email script then calling that email script is working