based on group want to display service accounts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2025 10:18 AM
There are 2 variables in catalog form one is group and 2 is service account based on selected group i need to show service accounts which are present in selected group. And also want to check if the requested for is the manager of the group them RITM should auto-approve else it should go the group maanger approval.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2025 11:56 PM
Service Account is True/false field if it is true then i need to show those service accounts only which are present in the group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2025 09:28 PM
Ensure your variable refers to sys_user and not sys_user_grmember table
what do you mean by service account is true/false field?
Are you saying you want only those users from that group which are having that field as true?
If yes then update as this
javascript: var query = '';
var arr = [];
var memberRec = new GlideRecord('sys_user_grmember');
memberRec.addQuery('group', current.variables.groupVariableName);
memberRec.addEncodedQuery('user.serviceAccountField', true); // give your encoded query here
memberRec.query();
while (memberRec.next()) {
arr.push(memberRec.getValue('user'));
}
query = 'sys_idIN' + arr.toString();
query;
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2025 01:58 AM
i need to get the service accounts part of that selected group. service Account is a true/false field in user table and we added those profiles to few groups
for example: if i selected It support group then i need to show only Service accounts part of that It support group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2025 12:01 AM
Service Account is True/false field if it is true then i need to show those service accounts only which are present in group