Add multiple dependants in field for Choice

Daniel O_Connor
Kilo Guru

Hi all,

Is it possible to add multiple references/qualifiers in the Dependent Value field for a Choice in a list.

The scenario at hand, is I have a custom app that operates across seven regions. The Category dropdown is different for all regions. However there are four regions where the below Label is required.

Be nice if I could just define the four departments in the Dependent Value field, as opposed to making the Label four times for each Department. 

Is this possible using the likes of an OR^ operator?

 

find_real_file.png

1 ACCEPTED SOLUTION

MrMuhammad
Giga Sage

Hi Daniel, 

 

We typically create separate record for each dependency or otherwise we use client scripts(not good when too many choices). You cannot use conditions in Dependent Value field. See screenshot below for reference. 

find_real_file.png

 

Please mark this Accepted & Helpful If it helps. 

 

Thanks & Regards,

Sharjeel

Regards,
Muhammad

View solution in original post

5 REPLIES 5

Gaurav Shirsat
Mega Sage

Hi Daniel

You can only add 1 dependent value using the dictionary dependent value functionality, if you need to add more you'll have to use a client script to add/remove options depending on values on the form.
 

depends on the field types you're working,Let's assume the below Fields:-

assume they're choice fields so you can use addOption() and removeOption() in an onChange script running on the category field.

The arguments for each method are ('string field name', 'choice value', 'choice label', 'choice order (optional)')

This is the Sample Script:-

if(newValue == 'hardware' && g_form.getDisplayBox('assignment_group').value == 'Hardware Group'){
g_form.removeOption('subcategory', '1', 'software option');
g_form.addOption('subcategory', '2', 'hardware option');
}

If you're just adding or removing an option here or there you can do this in the script, if you have more complex requirements then

I would recommend adding the choice options in a script include and using a GlideAjax call to return the options to the client.

as Suggested by these Experts,

Please Do Not Go for this if the Fields Choice is too Much.It's not Best Practice. Because we don't know,when and where one Bad Script written makes impact on which Filed.also Scripting adds and Load to the System.

 Please Mark Correct and Helpful

Thanks and Regards

Gaurav Shirsat