Hide UI Action in Header and Show Only at the Bottom
New article articles in ServiceNow Community
·
Jan 02, 2026
·
article
I had a requirement where we needed to hide a UI Action from the top form header and display it only at the bottom of the form.
UI Action:
When a UI Action is enabled as a Form button, ServiceNow automatically renders it in both the header and the bottom sections of the form.
Client Script:
function onLoad() { //Type appropriate comment here, and begin script below g_form.addInfoMessage("TEST1"); /* This line selects the UI Action button with the data-action-name value test from the form’s HTML using ServiceNow’s jQuery ($j) */ var ans = $j('[data-action-name="test"]')[0].hide(); g_form.addInfoMessage("Answer: " + ans); }
Disable Isolate Script:
Turn off script isolation (set Isolate Script = false) so the client script can interact with the form’s DOM elements.
What happens when made true?
When Isolate script = true, ServiceNow:
- Runs the script in a sandboxed scope
- Prevents access to:
- Global objects
- DOM
- window
- $j / jQuery
- Allows only safe APIs like:
- g_form
- g_user
- GlideAjax
UI Action on the Target:
Result:
Happy Learning!!
https://www.servicenow.com/community/common-service-data-model/hide-ui-action-in-header-and-show-only-at-the-bottom/ta-p/3459060