How do i hide sub sections in a form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2025 12:57 AM
Dear experts,
I tried to hide a form section but it did not went well, may I know why. I followed a solution accepted post, but it still not working on my side. I tried to hide the tab 'Applicability and Categorisation' but it did not hide for some reason. Please advise. I tried changing the code name from upper case, lower case and even added _ to it but all is not working for now.
function onLoad() {
var appliesTo = g_form.getValue('applies_to');
var engagementValue = 'engagement'; // replace with actual value stored in applies_to
if (appliesTo === engagementValue) {
g_form.setSectionDisplay('applicability_and_categorisation', false); // hide section
} else {
g_form.setSectionDisplay('applicability_and_categorisation', true); // show section
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2025 01:05 AM
Hi @ChuanYanF
This post might help you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2025 01:09 AM
are you sure you are comparing the correct value in the IF?
what type of field is applies_to
try adding alert and see
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
