Reference field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 08:56 AM
Hi All,
we have 2 variables one is choice and other is reference variable(group records) ,
upon selecting choice 1 in variable 1,in variable 2 it should show only groups ,if current logged in member is owner of any of the group. Kindly help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 09:56 AM
Hi @Mahesh4 ,
What variable 1 choice contains ,
For variable 2 : whats the field type of Owner, if its referance
you can do below (Replace Manger by Owner)
If you are looking groups whose owner is logged in user (Change of Variable 1 doesn't make sense).
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 01:05 AM
Hi @Hemanth M1
Thank you for your response ,
Actually variable 1 is select box and it has 3 choices like A ,B C.
and variable 2 is reference type of group table, so if logged in user selects variable A or B in variable 2 it should show all the groups but if he selects C in Variable 2 it should show only groups where logged in user is owner of.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 01:27 AM
in the 2nd variable add this in advanced ref qualifier. Ensure you give correct variable name and choice value and not choice label
I am assuming if user selects 2nd value from select box then it will show all groups.
Please enhance it based on your customer requirement
javascript: var query=''; if(current.variables.variable1 == 'choice 1') query = 'sys_idIN' + new global.ArrayUtil().convertArray(gs.getUser().getMyGroups()); 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