- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited 2 hours ago
I have created a custom tab to show custom fields related to specific model category only. I want this tab to be visible only for that model category only. I've created UI Policy to hide the fields and it works, but it still shows empty tab (section). I've tried all AI suggestions and they all failed.
Anyone has a working and proved solution for that?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
47m ago
section name is the name of that section in lower case and space replaced with underscore
Example: Resolution Information
g_form.setSectionDisplay('resolution_information', false)
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
share screenshots
You can use client script to hide form section using g_form.setSectionDisplay('sectionName', false)
This hides complete tab provided it doesn't have any mandatory fields
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
@Robert _ysakows You can use UI policy and in script section use below code for reference:
var modelCategory = g_form.getValue('model_category');
var targetCategory = 'Specific Category Name'; // Replace with the actual model category value
if (modelCategory !== targetCategory) {
// Hide the entire tab (section)
g_form.setSectionDisplay('custom_tab_section', false); // Replace 'custom_tab_section' with the actual section name
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Should I use section name or it's sys_id?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
47m ago
section name is the name of that section in lower case and space replaced with underscore
Example: Resolution Information
g_form.setSectionDisplay('resolution_information', false)
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader