
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2020 07:56 AM
I have a requirement to hide section without condition - can I achieve this through a UI policy?
I tried this option no luck..
On the When to apply tab, add your conditions.
On the Script tab, select "Run Scripts" then enter the following
Execute if True
function onCondition() {
g_form.setSectionDisplay('Accounts', true);
g_form.setSectionDisplay('Finance', true);
}
Execute if False
function onCondition() {
g_form.setSectionDisplay('Accounts', false);
g_form.setSectionDisplay('Finance', false);
}
any idea how to achieve this.?
Cheers,
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2020 08:02 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2020 08:01 AM
Yes, you can.
Just create a UI Policy without condition and go to UI Policy actions tab and select field(s) / section you want to hide by setting Visible select box to false.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 08:02 AM
Can you clarify how to select the sections you want to hide? I only see an option to select fields.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2020 08:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2020 08:15 AM
Hi,
whenever script is involved I would suggest to use onload client script; also you want to hide it always you can use onload client script without any condition
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader