Reference Qualifier -List Collector

JP6
Tera Contributor

I have a two fields on a form in portal which are referencing cmn_location table

field 1 State - Lookup select box
field 2 District - List collector

Both the fields are in the cmn_location table

When state value is selected then the corresponding value needs to be updated in list collector field

I have updated reference qual with this - u_district_type=current.variables.state

but it is not populating any value. Please assist with the gap.

 

 

4 REPLIES 4

Ashish Parab
Mega Sage

Hello @JP6 ,

 

Correction required in your reference qualifier as below.

Ref qual - javascript:'u_district_type=' +current.variables.state;

 

Note - Use appropriate field values like u_district_type and state.

 

Let me know if this not work for you.

 

Please mark this as "correct" and "helpful" if you feel this answer helped you in anyway.

 

Thanks and Regards,

Ashish

Chaitanya ILCR
Kilo Patron

Hi @JP6 ,

add variable attribute ref_qual_elements=state

ChaitanyaILCR_0-1748873517344.png

add advanced ref qual 

javascript:"u_district_type="+current.variables.state

 

else try this approach

https://servicenowguru.com/client-scripts-scripting/limiting-selections-list-collector/

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

Ankur Bawiskar
Tera Patron
Tera Patron

@JP6 

your 1st variable is Lookup select box means it's referring to cmn_location table

Then why to have 2nd variable again of type list collector?

u_district_type field on cmn_location has same choice values as that of the variable state?

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

JP6
Tera Contributor

The Which Territory? variable list collector retrieves parent values from the location table based on the selected state field in the form

 

 

JP6_0-1749972589383.png

 

 

Now my requirement is to populate district type values backed name(u_district_type) based on the selected state

I tried applying the reference qualifier below, but it’s not working, it keeps returning name values from the location table instead of district type values.

 

  1. javascript:'typeLIKE231753fbdbc3a700a84233f43a9619fb^u_brand=866a7848db857200d22bf389bf9619ca^nameNOT LIKECOHO^u_district_type=' +current.variables.state
  2. 'javascript: u_district_type=' + current.variables.state

Seeking your assistance on this