I have to set notification subject.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
I have to set notification subject. I have created notification on approval table and have to set notification subject and I have created email script and in that I'm setting order guide field value. I have to set order guide field value in notification subject.
Please find attached screenshot :
Notification :
Email Script :
Can you please help me to set subject.
Regards,
Nivedita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Ankur Bawiskar,
I'm having subject
Approval request for ${sysapproval.cat_item.name} Questionnaire -
and have to set subject after Questionnaire - Order guide field value.
Can I set Order guide field value from email script using email.setSubject.
When I use email script will it override subject Approval request for ${sysapproval.cat_item.name} Questionnaire - to Order guide field value.
Can you please confirm for that.
Regards,
Nivedita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
yes that's what I mentioned, don't give anything in Subject as you will set it using email script
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Ankur Bawiskar,
Can we use email script and add all Subject all together and have to set Approval request for ${sysapproval.cat_item.name} Questionnaire - Order guide field value
Can you please help me with that.
Regards,
Nivedita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Ankur Bawiskar,
I have to add notification subject as
- Approval request for <catalog_item_name> Questionnaire - <Name of Project/Initiative_Variable>
Can you please help me how to achieve that.
Regards,
Nivedita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
something like this
I hope you are aware how to call email script from email body
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
// Add your code here
var ritm = new GlideRecord('sc_req_item');
if (ritm.get(current.sysapproval)) {
var subject = 'Approval request for ' + ritm.cat_item.name + ' Questionnaire - ' + ritm.variables.initiative_name.getDisplayValue();
email.setSubject(subject);
}
})(current, template, email, email_action, event);
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader

