- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2017 12:44 PM
I have an approval user activity in my workflow. I am dynamically generating the approvers in the additional approver script. I am trying to get the sys_id of each approval record that is generated as it is generated via the script and storing it else where (weird I know). I will post my script below and place comments where I am thinking this should be executed.
var answer = [];
var sys_ids = [];
var grReqItem = new GlideRecord('sc_req_item');
grReqItem.addQuery('request',current.sys_id);
grReqItem.query();
while(grReqItem.next())
{
var selectedZones = grReqItem.variable_pool.zone_access.toString();
var individualZones = selectedZones.split(",");
for(var i = 0; i < individualZones.length; i++)
{
var grZoneManager = new GlideRecord('zones');
grZoneManager.addQuery('sys_id', individualZones[i]);
grZoneManager.query();
while(grZoneManager.next())
{
answer.push(grZoneManager.u_primary_zone_manager);
//I think it should be done here
sys_ids.push(/*Push the sys ids of the approval record that was just pushed on the line above*/)
}
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 09:17 AM
Turns out the approval record is not created until the entire activity is finished. So I had to add a timer for that runs the same time as the approval activity and then add a run script to capture the sys_id.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2017 01:10 PM
What is the requirement here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 09:17 AM
Turns out the approval record is not created until the entire activity is finished. So I had to add a timer for that runs the same time as the approval activity and then add a run script to capture the sys_id.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2023 01:58 AM
Hello,
Can you please let me know how to get approval sys_id in the next run script activity? Is it again by querying the Approvals table? But how to get exact approval sys_id which was generated in previous activity?
Quick response will be much appreciated