Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to hide choice in field in list records.

jacc_99
Giga Guru

Hi,

 

I can hide "New" choice option from State field in incident list.

jacc_99_0-1718706532874.png

I try this with client script and ui policy with script with g_form.removeOption('state', 1); gut it doesn't work.

 

Somebody can help me with this?

Is it possible?

 

Thanks in advance.

 

2 REPLIES 2

Slava Savitsky
Giga Sage

g_form API is only available in form view, not in lists. You cannot remove a choice in a list view, but you can use an onCellEdit() client script to validate the input and prevent that value from being saved if it gets selected.

jacc_99
Giga Guru

Hello,

 

It can be achieved put this choice to inactive.

In my case, I change state to "New" choice state through server script and with inactive choice it works.

 

Thanks Slava for your help!