Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

How to display dependent catalog Variable based on another Select Box Variables

Nisha30
Mega Sage

Hello Community,

 

Many threads went through for making dependent variable based on another variable.

 

Our requirement is 2 Select Box BoxA and BoxB. Both has many values.

 

How can I make BoxB certain values selectable when specific BoxA selected.

 

Clientscript is the last option any alternative ?

 

Thanks

7 REPLIES 7

Sujit Jadhav
Tera Guru

 

Hello @Nisha30 ,


Option 1 :

 

If Box A and Box B are both Choice type fields, you can link them directly through their dictionary configurations.

 

  1. Right-click Box B and select Configure Dictionary.
  2. Find the Dependent Field tab (or section).
  3. Check the Use dependent field checkbox.
  4. Select Box A as the dependent field.
  5. Save the record.
  6. Scroll down to the Choices related list.
  7. For each choice in Box B, double-click the Dependent value column and enter the exact Value (not Label) of the corresponding Box A choice.

 

Option 2 :

 

If Box A and Box B are Reference fields pointing to other tables, you should use an Advanced Reference Qualifier.

 

  1. Right-click Box B and select Configure Dictionary.
  2. Set the Use reference qualifier dropdown to Advanced.
  3. In the Reference qual field, enter a reference filter that references Box A's current value:
    javascript:'u_box_a_reference_field=' + current.variables.box_a_variable_name;

 

Option 3 :
Otherwise, Client script is the last option.

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"


Thank You,
Sujit Jadhav

Both Fields are 'Select Box' 

and

we have many choices against specific Value from BoxA.

 

I know client script will work but customer is looking if there is simple way other than Scripting.

Thanks

PoonkodiS
Giga Sage

Hi @Nisha30 

Creating Dependent Variables in Service Catalog? H... - ServiceNow Community

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0784512

To do your requirement when both variables are Select Boxes, can you change their Type to Lookup Select Box.