Hiding choices on a choice input in ServiceNow Agent app

Jaret Vik
Tera Expert

I want to hide 'Closed' and 'Resolved' on the State input choice list. We do not want our users to circumvent our close/resolve processes for incidents, but I would also like for them to edit the Incident State on the Agent app. I created a Mobile UI Rule, but it is not working. Any help here on hiding these options from the choice list?

 
JaretVik_0-1773924466956.jpeg

 

JaretVik_23-1773924413719.jpeg

JaretVik_24-1773924424725.jpeg

3 REPLIES 3

pr8172510
Mega Guru

Hi,

This issue occurs because the Now Mobile / Agent app does not fully support traditional client-side scripting like g_form.removeOption().

Mobile UI Rules and client scripts have limited capability in manipulating choice fields, so your script will not work as expected.

The recommended approach is to control visibility at the dictionary choice level:

1. Navigate to Incident → State field → Choices
2. Open the “Resolved” and “Closed” choice records
3. Add a condition to hide them for mobile users (e.g., using gs.getSession().isMobile())

Alternatively, you can use role-based or condition-based filtering on the choice records.

For best practice, also enforce the restriction using Business Rules or Flow Designer to prevent users from directly setting restricted states.

This approach is fully supported and works consistently across Mobile and Platform UI.

Thanks!

Hello, thank you for your reply.

For step 3, how do I add a condition for the choice? I do not see a condition field on the choice form, even when trying to edit the form layout.

JaretVik_1-1774281352563.png

 

Hi Jaret,

Good catch — you’re not missing anything here.

Choice records (sys_choice) do not have a “Condition” field out of the box, so you won’t see that option even if you try to personalize the form. My earlier note on that needed clarification.

What you can do instead:

  1. Server-side enforcement (recommended)
    Since mobile does not support dynamically hiding specific choices, the best approach is to control it with a Business Rule.

Create a Before Update Business Rule on Incident and prevent users from setting the state to Resolved or Closed when using mobile.

Example logic:
If gs.isMobile() AND state changes to restricted values → block the update and show an error message.

  1. Mobile limitation
    The Agent app does not support client-side methods like removing choice options or filtering them dynamically, so Mobile UI Rules and client scripts won’t work for this use case.
  2. Better UX approach
    If possible, consider hiding the State field in mobile and replacing it with controlled actions (like Resolve or Close buttons). This aligns better with how the mobile app is designed.