I need display values from two list collectors to show in another reference field

Vinuthna Ammana
Mega Guru

In a catalog form, I have two list collector field: "New Users" and "Old Users" which reference to 'sys_user' table.
I have another field - contact which is only reference to the User table but I only want the users selected in "New Users" and "Old Users" to show for this field,
I think I should use Onchange client script but do not know how to achieve it?

Regards,
Vinuthna
1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Vinuthna Ammana 

you can use advanced reference qualifier on that reference variable like this

Ensure you give correct variable names here

javascript: 'sys_idIN' + current.variables.listCollector1.toString() + ',' + current.variables.listCollector2.toString();

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

@Vinuthna Ammana 

you can use advanced reference qualifier on that reference variable like this

Ensure you give correct variable names here

javascript: 'sys_idIN' + current.variables.listCollector1.toString() + ',' + current.variables.listCollector2.toString();

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

I tried this but I can see all users instead of selected ones, I ensured I gave correct variable names.

Regards,
Vinuthna

@Vinuthna Ammana 

reference field can hold only single value.

with above it will allow user to select only 1 user from the combination of both the list collector

reference qualifier I shared will work provided you give correct variable names

share screenshots of your variable configuration which shows it's name and the variable where ref qualifier is applied

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

yes, I want to allow user to select only 1 user from the combination of both the list collectors
I am not allowed to share screenshots, but please find

javascript: 'sys_idIN' + current.variables.new_users_to_be_members.toString() + ',' + current.variables.Users_to_be_members.toString();

Backend names are correct, List collector - list table is User table and ref qualifier is active=true^u_store=false^u_integration_user=false^u_primary_groupISEMPTY^EQ

Regards,
Vinuthna