Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Setting 'setSectionDisplay' function to 'false' does not hide the form section. - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Setting 'setSectionDisplay' function to 'false' does not hide the form section.
KB0696583

Setting 'setSectionDisplay' function to 'false' does not hide the form section.


19934 Views Last updated : Jul 15, 2025 public Copy Permalink English (Original)
  • English (Original)
  • Japanese
KB Summary by Now Assist

Issue

After setting the g_form.setSectionDisplay function to 'false' in a client script, it does not hide the form section on page load.

g_form.setSectionDisplay('<section_name>', false);

Release

.

Cause

There could be two causes for this:

  1. The setSectionDisplay function not working properly is due to how the section name is used within the function.
  2. There are mandatory fields within the section that is being hidden.

Resolution

For #1

As per the documentation on setSectionDisplay, the section name is in lowercase 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.

For #2

It is expected behavior that if there are empty mandatory fields within the section being hidden the section itself will not be hidden. The reason is that users won't be able to see which mandatory fields to fill out if the section that contains them is hidden. If all mandatory fields have values then the section will hidden.

*note - In workspace forms, there was a defect where if the section contained any mandatory field, the section would not be hidden, even if the mandatory field had a value. The was resolved in Y release to match the UI16 behavior.

Related Links

  • GlideForm Client
  • GlideForm - setSectionDisplay

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.