hide a section on change request form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
g_form.setSectionDisplay("A", newValue == 'A');
g_form.setSectionDisplay("a", newValue == 'A')
}Hi @sharley ,
Try this
Is the name of the section is correct ? Or backend name of the value "A" correct?
To know the section name
Follow this
The backend name for a ServiceNow form section is its label converted to lowercase, with the first space becoming an underscore and subsequent spaces/special characters removed (e.g., "Caller Details" becomes caller_details). You find these by using the g_form.getSectionNames() API in a client script for dynamic retrieval or by configuring the Form Layout to see the names.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
14m ago
@sharley You don't need return in this case. Your script is correct, you probably need to check the backend value of type "A" and UI section name should be correct.
Refer: https://www.servicenow.com/community/developer-forum/get-form-section-name/m-p/1971485 explanation for section names