Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 01:31 AM
I have a variable with list collector type with user table when we select multiple users in a variable then approval should send for those users Managers.
Present approval is going to only Requested for manager as below. we need to send approval to above selected users manager as well.
Any lead will be helpful
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 01:54 AM - edited 11-05-2024 01:55 AM
answer = [];
var usr = new GlideRecord('sys_user');
usr.addEncodedQuery('sys_idIN'+current.variables.<listcollectorvarriablename>); //replace with list collector variable name
usr.query();
while (usr.next()) {
if (usr.manager)
answer.push(usr.manager + '');
}
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 02:04 AM
Hi @wefw ,
Try this out
var usrGr = new GlideRecord('sys_user');
usrGr.addQuery('sys_id', 'IN', current.variables.select_users); //replace your variable name
usrGr.addNotNullQuery('manager');
usrGr.query();
while (usrGr.next()) {
answer.push(usrGr.getValue('manager'));
}
Regards,
Chaitanya