Remove choice list options from list view

arpitt
Tera Expert

Can some choice list options be removed for certain roles from a list view dynamically??

5 REPLIES 5

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Arpit,



There is no option to remove choice value from the list view. However as alternative you can restrict the update on list edit operation(ACL) and restrict the access.


rob_pastore
ServiceNow Employee
ServiceNow Employee

This is straight from the wiki:



which will remove state '7' for everyone who is not admin



function onLoad() {


    var isAdmin = g_user.hasRole('admin');


    var incidentState = g_form.getValue('incident_state');


    if (!isAdmin && (incidentState != 7)){


  g_form.removeOption('incident_state', '7');


    }


}




GlideForm (g form) - ServiceNow Wiki


Hi Robert,



Will this work on list view?


Oops, I missed that important fact.


In those cases I would normally do as you suggested and use the ACL to not allow list edit for that field.