- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2022 09:31 PM
Hello Team,
I created a Flow Design to send out approval email reminders every 7, 14, 30 days etc. The reminder notifications (using sysApproval table) to the Approver is being sent and is working fine. However, I also need to send the same email to the Caller/Opened for of the Request, this part is not working. I added a script to the Flow as follows:
The Request to fetch the Caller or Opened for name from the Request ie:
I also tried this, which does not work either:
var callerid = fd_data.trigger.current.sysapproval.getDisplayValue();
var gr = new GlideRecord('facilities_request');
gr.addQuery('number' , callerid);
gr.query();
while (gr.next())
{
var callerid = gr.request.caller.sys_id;
}
return callerid;
Any assistance would be much appreciated. Thank you.
Solved! Go to Solution.
- Labels:
-
flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2022 08:07 PM
Hi,
use this script
I assume you have caller as reference field on table facilities_request
var sysId = fd_data.trigger.current.sys_id;
var rec = new GlideRecord('sysapproval_approver');
rec.get(sysId);
var callerid;
var gr = new GlideRecord('facilities_request');
gr.addQuery('sys_id', rec.sysapproval).addOrCondition('sys_id', rec.document_id);
gr.query();
if(gr.next())
{
callerid = gr.caller.sys_id;
}
return callerid;
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
04-03-2022 09:48 PM
Hi,
flow is on which table?
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
04-04-2022 12:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2022 08:07 PM
Hi,
use this script
I assume you have caller as reference field on table facilities_request
var sysId = fd_data.trigger.current.sys_id;
var rec = new GlideRecord('sysapproval_approver');
rec.get(sysId);
var callerid;
var gr = new GlideRecord('facilities_request');
gr.addQuery('sys_id', rec.sysapproval).addOrCondition('sys_id', rec.document_id);
gr.query();
if(gr.next())
{
callerid = gr.caller.sys_id;
}
return callerid;
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
04-25-2022 09:15 PM
Thank you Ankur, your script helped me in the right direction and it worked 🙂