
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 06:53 AM
I read (in full) Show/Hide Form Section by Name - ServiceNow Guru
So... when using g_form.setSectionDisplay(), where do you define the section name????
What field on the sys_ui_section will go in the first parameter of g_form.setSectionDisplay() ???
I tried the following:
But it doesn't work.
Solved! Go to Solution.
- 38,543 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 07:16 AM
This is not correct. Naming conevtion is as follows
"The section name is lower case with an underscore replacing the first space in the name, and with the remaining spaces being removed, for example "Section Four is Here" becomes "section_fourishere". Other non-alphanumeric characters, such as ampersand (&), are removed. Section names can be found by using the getSectionNames method."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 07:09 AM
Hi David,
I have recently do this and based it on the caption (View name is blank)
My caption name is Escalation and my client script is g_form.setSectionDisplay('escalation', false);
try g_form.setSectionDisplay('hardware serial numbers and asset tags', false); or g_form.setSectionDisplay('Hardware Serial Numbers and Asset Tags', false);
Note: it won't hide if it is the 1st section on the form and may not work if there are mandatory fields (to be verified)
Ray

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 07:15 AM
Thanks for the reply.
I tried using the caption name, but it didn't work either.
Also, there are no mandatory fields within the section at all.
Yes, initially my "View Name" was blank too, but I went into the sys_ui_section table and manually added hardware_serial_numbers_and_asset_tags because I thought that was the trigger. Nope.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 07:16 AM
This is not correct. Naming conevtion is as follows
"The section name is lower case with an underscore replacing the first space in the name, and with the remaining spaces being removed, for example "Section Four is Here" becomes "section_fourishere". Other non-alphanumeric characters, such as ampersand (&), are removed. Section names can be found by using the getSectionNames method."

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 07:15 AM
Use this in the section name inside setSectionDisplay() function
g_form.setSectionDisplay('hardware_serialnumbersandassettags',false);