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

changed to 

 

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

It is working now 

Regards,
Vinuthna

@Vinuthna Ammana 

Thank you for marking my response as helpful.

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

@Vinuthna Ammana 

Glad to know that my response worked.

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

@Vinuthna Ammana 

Hope you are doing good.

Did my reply answer your question?

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

Bert_c1
Kilo Patron

A Reference field will only hold a single value, See:

 

DatabaseFieldTypes.html

 

Look at the definitions of the three fields and the max lengths for those.