- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2020 12:09 PM
I've been asked to hide a UI action button on a form until a user makes a selection on a particular drop-down field. In my case, I'm working in a global application called 'ticket', which is an extension of the task table. Tickets are created by end-users and fielded by the help desk, which reviews them and transfers them to the appropriate type of record (incident, RITM, problem, etc.) and assigns them to the appropriate group.
The bug right now is that the transfer button can be clicked before the help desk worker actually decides what kind of record to transfer the ticket to. I know how to restrict the button on the UI action record itself by adding a condition to the button. However, this only works 'onLoad'. So this method would require the help desk worker to take three actions:
- Select the type of record to transfer to in the drop-down
- Save the form
- Click the 'transfer' button which is now visible after re-loading the form
I'm hoping that there is a way for them to avoid clicking the save button and re-loading the form, so basically utilizing an onChange script or UI Policy. However, in searching the community, all of the solutions involve DOM manipulation, which is not considered best practice.
Additionally, I've tried the method found here:
https://community.servicenow.com/community?id=community_question&sys_id=2cf54361db1cdbc01dcaf3231f96...
But I'm running into the same error reported with the jquery method not being a function.
Does anyone know if this method stopped being supported in New York, or if there is any other way to show/hide a button based on another field value without reloading the form?
Solved! Go to Solution.
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2020 06:38 PM
Hello @Matt Grover
Can you try adding the "Isolate script" filed to the UI Policy form and set it to false or uncheck it.
go to configure---> form layout and drag it over to the form
and run it again.
It should be false to allow your DOM manipulation to work.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2020 12:18 PM
you can use condition in UI action to show, hide button based on your requirements.
you can access current object values in UI condition.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2020 12:22 PM
Hello Sachin,
Thanks for looking into this. I believe setting the condition in the UI action will hide the button, but it only works 'onLoad' at least from my experimentation. I am looking for something that will be triggered as soon as the dependent field value is changed, so they don't have to click save and reload the form in-between selecting the ticket type and clicking the transfer button.
Thanks,
Matt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2022 07:06 AM
How

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2020 06:38 PM