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.
Service Portal: Variable set not hidden with g_form.setDisplay() function in a Catalog Client Script - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • Service Portal: Variable set not hidden with g_form.setDisplay() function in a Catalog Client Script
KB0610336

Service Portal: Variable set not hidden with g_form.setDisplay() function in a Catalog Client Script


19337 Views Last updated : Apr 7, 2024 public Copy Permalink English (Original)
  • English (Original)
  • Japanese
KB Summary by Now Assist

Description

In Service Portal, variable set is not hidden when using g_form.setDisplay(<variable set name>, false) in a Catalog Client Script.

Steps to Reproduce

 

  1. Navigate to Service Catalog > Catalog Definitions > Maintain Items and select the Standard Laptop item.

  2. Under Related Links, go to Variable Sets and click New.

  3. Add a variable set named Test and click Submit.

  4. Select the variable set and click New under Variables.

  5. Add a variable to the variable set with the following values:

    Question: Test var.
    Name: test_var
    Type: Single Line Text.

  6. Return to the Standard Laptop item and under Related Links, go to Catalog Client Scripts and click New.

  7. Add a client script with the following values:

    Name: hide test.
    UI Type: Both
    Type: onLoad
    Script: function onLoad() {
       //Type appropriate comment here, and begin script below.
       g_form.setDisplay('test', false);
    }

  8. Navigate to Service Portal > Order Something > Hardware > Standard Laptop.

    Note that although in Service Catalog the Test variable set is hidden, it is displayed in Service Portal.

Workaround

The intent with Service Portal is to enable our customers to provide modern, easy-to-use, device agnostic experiences for their end users or requestors. We do not intend to provide full feature parity between the Platform experience and the Service Portal experience. However, we do understand that you may have built out catalog item forms that are fairly complex and do not render well in the Service Portal today. Hopefully, the updates provided in the link below will help you overcome some of those challenges.

https://community.servicenow.com/community/service-automation-platform/blog/2017/05/05/service-catalog-on-service-portal

If they do not, there is an update set within the link that adds 2 new fields to the sc_cat_item table using iFrames but has changes that mask the iFrame experience.

Before using the update set, please understand:

  • This approach is not a product offering, but only provided as an option that you can use, if you choose to do so. There will be NO SUPPORT for this.
  • This is intended to be a short-term option so you can continue to use the Service Catalog on the Service Portal, while you set in motion plans to transform your catalog item forms to fit the Service Portal experience.

 

 


Related Problem: PRB718745

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.