
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2014 06:18 AM
Hi all,
I think I'm trying to do something pretty simple.
I have a few variables on my catalog item form that I need to pull into an email notification. One of the fields being 'alt_poc_phone'
I've tried GlideRecord and current.variable_pool.alt_poc_phone and neither seems to work.
I've also referenced the following wiki page (Scripting for Email Notifications - ServiceNow Wiki), but something's not clicking (on my part).
Any help is greatly appreciated (with examples)
MM
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2014 04:47 AM
Mandar/Adam-
Follow up to my post. For some reason the mail script is working now. I'm not sure why it wasnt' working earlier. I guess I had a typo or something.
Here's the script that works:
<mail_script>
var item = new GlideRecord("sc_req_item");
item.addQuery("request", current.sys_id);
item.query();
while(item.next()) {
var catalogItem = item.number + ': ' + item.cat_item.getDisplayValue();
var misc = item.variable_pool.alt_poc;
template.print(catalogItem + "<br/> Field: " + misc);
}
</mail_script>
Really appreciate the feedback guys, couldn't have done this without you-
On to my next challenge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2018 12:11 AM
I have tried different things but cant seem to get it to work but my scripting skills are not that great.
Can you give me an example.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2019 03:12 PM
I've just posted an example below of what I am personally using now. This also shows I am excluding certain variables based on name. Hope that helps you.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2019 09:31 AM
Hi Hadyn,
Do you know if this still works in London? I'm having trouble with it particularly on items that use a combination of variable sets and item variables. It will print a 'display value' that's a list of every variable and value in one of the variable sets.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2019 03:11 PM
Not sure when I changed to this code, but this is what I am using now and I am on London currently.
template.print("Options:\n");
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(item.sys_id);
set.load();
var vs = set.getSummaryVisibleQuestions();
for (var i=0; i < vs.size(); i++) {
if(vs.get(i).getLabel() != '' && vs.get(i).getLabel() !== null && vs.get(i).name != 'lpo' && vs.get(i).name != 'poa') {
template.space(4);
template.print(vs.get(i).getLabel() + ": " + vs.get(i).getDisplayValue() + "\n");
}
}
template.print('\n');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2017 01:36 PM
Matt,
Im trying to do the same thing and its not working out so well. Would you be able to assist?