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:45 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2022 03:49 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2022 04:01 AM
Hi,
you can use email script and get the instance name using this
var instanceName = gs.getProperty('instance_name');
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2022 05:06 AM
you need to use email script and include line I mentioned above
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader