How to trigger a single notification to requestor for the Approval record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Team,
We have a requirement to auto cancel any RITMs, that are not approved within 30days. We are looping through approval records (sysapproval_approver) table, fetching the RITMs, then calling the notification which is sending emails to each approver separately for the same approving record.
Current behavior: User is receiving multiple notifications along with approving user.
Expected Behavior: Our goal is to notify the user via Additional comments (without sending multiple notifications to the requestor).
Flow configuration:
Notification:
Please verify our Flow and let us know how can we trigger a notification to the Requestor (via single notification specific to one ticket) instead of multiple notifications which is happening happening via For-each loop.
Thank you in advance!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12 hours ago
Hi @JaganN971616731 ,
You can remove steps 2–5 and use the Set Flow Variables action with script step instead. In the Script step, use the below script as a reference to set the flow variable value:
var ritmIds = {};
var result = [];
var approvalGR = new GlideRecord('sysapproval_approver');
approvalGR.addQuery('state', 'IN', 'approved,rejected,cancelled');
approvalGR.addQuery('source_table', 'sc_req_item');
approvalGR.query();
while (approvalGR.next()) {
var ritmId = approvalGR.getValue('sysapproval');
if (ritmId && !ritmIds[ritmId]) {
ritmIds[ritmId] = true;
result.push(ritmId);
}
}
return result.join(',');
This will return the unique RITM sys_ids as a comma-separated value.
If you find this useful, please mark it as helpful.
Thanks & Regards,
Harish
