- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2018 02:15 PM
Hello,
I am trying get approval sent to manager of reference field variable and I have tried everything. I have approval user activity.
I have tried
answer[];
answer.push(current.variables.saowner.manager);
This below as well
answer = [];
if(curent.variables.saowner)
{
var saownermanger = new GlideRecord('sys_user');
if(saownermanager.get(current.variables.saowner)){
answer.push(saownermanager.manager);
}
}
Everytime it says skipped. Do I need an if activity to check to make sure saowner is not null which it can never be since is required. Also I checked to make sure the user had a manager and they do.
Any assistance is appreciated.
Thanks,
Chad
Solved! Go to Solution.
- Labels:
-
Workflow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2018 01:11 PM
I don't see any issue with your script. Also make sure the manager's account is active.
Can you try
answer='';
if(curent.variables.saowner)
{
answer=current.variables.saowner.manager.toString();
}
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2018 02:18 PM
You are on the right track by checking for a null value first.
answer = [];
if(curent.variables.saowner)
{
var saownermanger = new GlideRecord('sys_user');
if(saownermanager.get(current.variables.saowner)){
answer.push(saownermanager.manager);
}
}
Are there any indications in the system log of what might be going on?
Have you tried using a gs.info() statement or two to confirm the variables contain what you think they do?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2018 02:19 PM
Are you running this workflow on Request table or Requested item table. if it is running on Request table, you will have to query the Requested Item table to get the variable.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2018 06:55 AM
Requested Item. Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2018 01:11 PM
I don't see any issue with your script. Also make sure the manager's account is active.
Can you try
answer='';
if(curent.variables.saowner)
{
answer=current.variables.saowner.manager.toString();
}
Please mark this response as correct or helpful if it assisted you with your question.