Hide choice from List field type

dmathur09
Kilo Sage
Kilo Sage

Hi Everyone,

I have list type of field which is not referring to any table but have certain choice. Refer below screenshot of dictionary of the field.

find_real_file.png

The requirement is to hide certain choice value dynamically based on some condition, like checkbox. If the checkbox field is true hide 3 choices out of 4 in the form.

I do not want to use any DOM manipulation. I also tried g_form.removeOption but it did not work on list type of field.

Any leads would be appreciated.

Regards,

Deepankar Mathur

7 REPLIES 7

Talha3
Kilo Guru

Hi Deepankar,

You can simply create a UI Policy and use the following condition: 

If variable A = True then in the UI policy action select the choice name and make visible = false.

This should work.
Please mark this correct if answers your question.
 

dmathur09
Kilo Sage
Kilo Sage

Hi Tahla,

Thank you for your response. However in UI Policy, I am unable to dot-walk to the choice. Refer the screenshot below.

find_real_file.png

Regards,

Deepankar Mathur

DrewW
Mega Sage
Mega Sage

I know you don't want to but I'm reasonably sure you are going to have to use DOM manipulation to add and remove values you do not want people picking because its a list.

Hey Drew,

We do not want to any DOM manipulation as it is not a best practice nor  recommended by Servicenow

Thanks

Deepankar Mathur