Remove --none-- option from dependant field

vaibhavdesai
Kilo Expert

Hello Experts,

How to remove --none-- option from dropdown of dependant field?

I have one field named "Stage". Values of this field are dependant on "State" field. Currently, we have --none-- value in dropdown. And I want to remove that value. But, Directly changing option of "Dropdown without --none--" is not working.

Currently, Choicelist values are not managed by client script. We have added values of "state" field on "Dependant Value" in "Stage" field choice list.

Is there any possible solution for this issue. OR do I have to remove all the values from "Dependant value" in dictionary entry of "Stage" field and Create Client Script to populate values and than change the option of "Dropdown without --none--".

Thanks in advance:-)

Regards,

Vaibhav

1 ACCEPTED SOLUTION

goto 3.3 Removing the -- None -- Option



the note says


Note: If the field is dependent on another field, the -- None -- option remains available.




View solution in original post

10 REPLIES 10

zica
Giga Guru

Vaibhav,



You can use the option 'Dropdown without --none--" but you have to specify a default value in this case.


Either you specify for example the first value of the list as default value but that won't be always the case. I suppose that as stage depends on state, it should have specific values depending the state chosen.


I will suggest you to create a client script will will clear all the values of stage until state is not chosen.


From there, depending on the value chosen on state, you can add / remove values from stage.


Here is a thread that is very helpful for script this task : Removing or Disabling Choice List Options - ServiceNow Guru



Kind regards,


ZA



Do not feel shy to mark correct or helpful answer if it helps or is correct



Namrata Makasa1
Giga Expert

hey,



You need to use the option 'Dropdown without --none--" but you have to specify a default value in this case.


Since your field values depend on the values of State, State field must be having some default value say "New".


So select the first value among the bunch of dependants values for Stage for 'New' State and set it as the default value for Stage in its dictionary along with "Dropdown without --none--".



Hope it helps.....!!!!!!!!!!



Regards,


Namrata


vaibhavdesai
Kilo Expert

Hi,



I already added Default value. But, It is not working.



Namrata as you suggested I tried adding default value of state field and tried adding value of stage field which is dependant on default value of state field. none of that work.



Regards,


Vaibhav