Get list of users from another field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2025 04:42 AM
Hello Experts,
I have a query. I want to set up a qualifier on a glide list type field. The users on the list will be same as users available on another glide list field present on another form.
Example : Form A contains Managers field , we have 3 records in this field.
Form B contains Assigned to field. Only those 3 records from Managers field will be the available choices of this Assigned to field. From there we can choose any records.
Please, if any help is well appreciated.
Regards'
Souvick
Thanks in Advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2025 05:03 AM - edited 03-27-2025 05:06 AM
Hi @Souvick6917
Does Form B have a reference field that refers to a record from Form A?
If yes, the you can use below script in the ref qualifier of the field in Form 2.
javascript:"sys_idIN"+<form 1 ref variable>.<field name from form 1>.toString();
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2025 05:05 AM
Hi @Souvick6917,
There are a couple of ways to achieve this off the top of my head if I understand the 'ask' correctly.
The glide list field from Form B simply needs to have the same reference qualifier as the glide list field from form A. Eg users who's manager field is not empty.
Note, whilst the quick and easy way to implement would be to simply use the same simple qualifier configuration, if this will always be the same, I'd be inclined to leverage an advanced ref qualifier and call a script include.
By doing so it would mean you have one place to maintain this logic for these fields and any other that require the same logic moving forward.
Quick clarification question. Is this on the catalog or a task table related form such as incident etc. You could also use the same field as it were but use a dictionary overload to change the label etc.
Here's a quick link to configured the list field reference qualifiers including the simple and advanced options from the SN Docs site:
To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2025 05:15 AM
I think you can write advance reference qualifier and call script include on second form field:
getManagerList: function(current) {
var managerList = [];
var gr = new GlideRecord('Form A Table Name');
if (gr.get('sys_id', '<current.fieldNameWhichReferestoFormA>')) { /
var managers = gr.getValue('u_managers'); // Replace with actual field name
if (managers) {
managerList = managers.split(','); // Managers field contains comma-separated sys_ids
}
}
return 'sys_idIN'+managerList.toString().join(',');
},
Call this function "getManagerList" in your reference qualifier:
javascript: new ScriptIncludeName().getManagerList(current);
Please mark correct helpful if this helps you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2025 05:18 AM
simply use this if on Form A you have a fieldA and within that there is a list field
javascript:'sys_idIN' + current.formAField.listField.toString();
use this if on Form A you have a list field and within the same Form another field needs to be filtered based on above field
javascript:'sys_idIN' + current.formAField.toString();
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