- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2018 10:03 AM
I have a Lookup Select Box on a catalog form (variable name TS_mgr). I have a reference qualifier on the variable to pull the names out of a assignment group call TS Managers and that is working:
javascript:var gr = new GlideRecord('sys_user_grmember');gr.addQuery('group',"2fa4a9320fb2c200a91a244be1050e06");gr.query();var users='';while(gr.next()){users+=gr.user.sys_id + ",";}"sys_idIN" + users;
In the workflow I have a Approval - User item scripted a such:
answer = [];
answer.push(current.variables.TS_mgr);
The form works correctly in that it pulls the names of the user in the group. When the workflow calls the Approval - User item it skips it and I'm not sure why. I'm thinking it may be getting a null value so it thinks there is no approver? Do I need to convert the variable to a string first (wouldn't think so)?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2018 12:38 PM
That is what I expected. The answer array of an approval expects an array of sys_id values. See if you can change the Lookup value field to be SysID. You may also have to change the Lookup label(s) to be name so that the users will show up correctly.
Typically I use a reference field to pick the user, but since you have a lookup select box this makes the results a bit different.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2018 10:09 AM
try answer = [];
answer.push(current.variables.TS_mgr.toString());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2018 10:15 AM
Nope. Getting the same thing. Is still skipping the Approval task. I guess why else would it be skipping the approval task?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2018 10:19 AM
try
answer = current.variables.TS_mgr;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2018 10:24 AM
also try
try answer = [];
answer.push(current.variables.TS_mgr.sys_id);