- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2020 08:17 AM
Hi Team,
I have a requirement to trigger a notification.
The notification is created on 'Sysapproval_approver' table.
I have to send this notification to a email id which is present in the 'sc_req_item' form. Variable name in sc_req_item is : 'local_procurement'.
So my notification is getting fired based on condition, it is having the RITM number, how I can write email script to get the value of variable 'local_procurement' and pass this via email script made calling on sysapproval_approver table to trigger the notification to that email id(local_procurement).
Please suggest.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2020 09:52 PM
Hi Geeta,
in workflow you can use wait for timer activity for waiting and then sending email
You can include schedule as well for excluding weekends
If you are stuck inform the issue.
Please consider marking appropriate reply as ✅Correct & 👍Helpful.
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
05-17-2020 09:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2020 12:15 AM
Hi Jaspal,
I am still getting undefined in 'cc' . Not sure why, even though in form 'sc_req_item' I have value in local_procurement field(text field).
Also, I want to send the notification to this local_procurement with 'TO' option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2020 12:19 AM
Also just to add, notification is configured in 'sysapproval_approver' table not in sc_req_item table.
Ntification is getting triggered from flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2020 06:02 AM
Hi Jaspal,
I tried with flow designer(has i have to check 'wait for certain time period' and this was easy to do via flow) . But I think my requirement will not be possible via flow designer.
So the requirement is as below :
In 'sc_req_item' form for a catalog I have a variable 'local_procurement' which has email id(ex geeta.dhami@test.com).
Once the request is approved, the state is set to 'On-Hold' and Approval as 'Approved'.
I have to design a job/process, that checks if the state is 'On-Hold' for that request, then wait for 2 weekdays(excluding weekend) and then send a reminder 1 email to 'Local_Procurement' id.
Then again wait for 2 more days(Weekdays) and then check if still the state is 'On-Hold' , then send reminder 2 email to 'Local_procurement' id.
Again wait for 2 more days(weekdays) and check is state is still 'On-Hold', then mark the state for the request as closed incomplete.
Please suggest.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2020 06:10 AM
You could use the below script include to push variables to email notification
template.print("Summary of Requested items:\n");
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(current.getValue('sysapproval'));
set.load();
var vs = set.getFlatQuestions();
for (var i = 0; i < vs.size(); i++) {
if (vs.get(i).getLabel() != '' && vs.get(i).getDisplayValue()!='' && vs.get(i).getDisplayValue()!='false') {
template.space(4);
template.print(vs.get(i).getLabel() + " = " + vs.get(i).getDisplayValue() + "<br/>");
}
}