How to hide choice field on incident form? for example: If I have added phone as an choice on incident form and I don't want the users to view that phone choice what to do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2022 12:07 AM
How to hide choice field on incident form? for example: If I have added phone as an choice on incident form and I don't want the users to view that phone choice what to do?
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2022 12:27 AM
Hello,
If you want to hide Phone for everyone , either you can make that choice and inactive true or you can remove from choice list by going to 'Configure choices' for that field.
Please hit like and mark my response as correct if that helps
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2022 12:29 AM
I don't want to make it inactive. I just want to hide it on incident form.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2022 05:46 AM
function onLoad() {
//Type appropriate comment here, and begin script below
if(!g_user.hasRoleExactly('admin'))
{
g_form.removeOption('contact_type', 'phone');
}
}
Also, if you want to hide it for all then simply go to 'Configure choices' and remove accordingly simple ?
Please hit like and mark my response as correct if that helps
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2022 01:01 AM
Hello Bhavya,
You can use the following method:
GlideForm - removeOption(String fieldName, String choiceValue)
g_form.removeOption('choice name', choice value);
Please also check here if you have any questions:
https://docs.servicenow.com/bundle/tokyo-application-development/page/app-store/dev_portal/API_reference/GlideForm/concept/c_GlideFormAPI.html#r_GlideFormRemoveOption_String_String
Please mark as correct/helpful if it helps 🙂
Also, Please be more specific from next time when you are asking a community question.
How to hide choice field on incident form? for example: If I have added phone as an choice on incident form and I don't want the users to view that phone choice what to do?
At one stage, you mentioned to hide choice field after you added to hide phone as a choice. It's confusing.
Thanks!