- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2022 01:24 PM
Hi,
I am working on a workflow where the manager of the user the request is for should become the approver. In the workflow, I have added an 'Approval - User' and in the approver's section under advanced I added a line that sets the answer to the user's manager. However, when I trigger the workflow it is not sending out an approval email to the manager and is just auto approving and going to the next step in the workflow. Does anyone know what I am missing here? Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2022 02:53 PM
The code should be:
answer = [];
answer.push(current.variable.access_requested_for.manager); //you may need to add .toString() after manager.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2022 02:53 PM
The code should be:
answer = [];
answer.push(current.variable.access_requested_for.manager); //you may need to add .toString() after manager.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2022 03:17 PM
This didn't work but led me to the right answer. I had to do a GR call to find the manager then user .push method. Thank you for your help!
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id', current.variables.access_request_for);
gr.query();
while(gr.next()){
if(gr.manager != ''){
answer.push(gr.manager);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2022 03:22 PM
Hello - Did you try:
answer = [];
answer.push(current.variables.access_request_for.manager.sys_id);
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2022 03:27 PM
you shouldn't need to do a glidrecord. You may need to add toString() to the second line.
answer.push(current.variables.access_requested_for.manager.toString());