- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2017 01:21 PM
Hello Experts,
I have a request regarding email notifications. How can we prevent empty fields of a catalog item from appearing in the email notifications.
Thanks,
SD.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2017 10:59 AM
if(vs.get(i).getLabel() != '' && vs.get(i) .getDisplayValue() != '' && vs.get(i) .getDisplayValue() != 'false'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2017 01:23 PM
Wrap it in a mail script that checks each field for a value before writing it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2017 01:26 PM
Hello Robert,
This is the message i have in my email template. Where exactly I have to do that??
Request: ${sysapproval}
Requested By: ${sysapproval.opened_by}
Requested For: ${sysapproval.requested_for}
Short Description: ${sysapproval.short_description}
<hr/>
<mail_script>
template.print("Summary of Requested items:\n");
var item = new GlideRecord("sc_req_item");
item.addQuery("request", current.sysapproval);
item.query();
while(item.next()) {
template.print(item.number + ": " + item.quantity + " X " + item.cat_item.getDisplayValue() + " at " + item.cat_item.price.getDisplayValue() + " each \n");
template.print(" Options:\n");
var keys = new Array();
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(item.sys_id);
set.load();
var vs = set.getFlatQuestions();
for (var i=0; i < vs.size(); i++) {
if(vs.get(i).getLabel() != '') {
template.space(4);
template.print(' ' + vs.get(i).getLabel() + " = " + vs.get(i).getDisplayValue() + "\n");
}
}
}
</mail_script>
Click here to view Approval Request: ${URI}
Click here to view ${sysapproval.sys_class_name}: ${sysapproval.URI}
<hr/>
${mailto:mailto.approval}
<hr/>
${mailto:mailto.rejection}
<hr/>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2017 01:41 PM
In this if(vs.get(i).getLabel() != '') { loop add the below condition
if(vs.get(i).getLabel() != '' && vs.get(i).getDisplayValue() != ''){
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2017 09:03 AM