- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 01:59 PM
Hi All,
I have created email script which should return link to all catalog items one particular service owner owns. Below is email script I created. In this case, there are 3 catalog item Test user owns, I checked logs and url is returning 3 different links BUT in notification only first one is coming correctly and for other 2, sys_id is blank.
and Catalog item is are not coming in line even after using "\n"
Please can someone help me understand what I am missing please
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 05:15 PM
Below is Email Script:
// Add your code here
var cNames = event. parm2. tostring();
var cat item link = ''
var cat_item = new GLideRecord ("sc_cat_item") ;
cat_item. addEncodedQuery ('sys_idIN'+ cNames) ;
cat_item. query ();
while(cat_item.next()){
template print ("<a href='https://"+gs.getProperty ('instance_name')+". service-now.com/portal?id=sc_cat_iten&sys_id= "+cat_item.sys_id.toString()+" ' target='_blank' > " + cat_item.name.toString() + " </a><br>");
}) (current, template,
email, email action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 02:15 PM - edited 02-14-2024 02:16 PM
Hi @Rutuja K ,
When setting the 'link' variable, did you put 'instance URL' as a string on purpose?
If not, try replacing line 15 with
var link = gs.getProperty('glide.servlet.uri') + "/portal&sys_id=" + array[i];
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 02:18 PM
Hi James,
Thanks for response.
I used getProperty API, Too post code on community, I changed it to "Instance URL"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 03:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 03:25 PM
Hi James,
I tried removing \n, but still getting blank sys_id in emails.