setVisible is not working on catalog client scripts and does not hide variables in Service Portal.

Steps to Reproduce


  1. Navigate to Service Catalog > Catalog Variables > Variable Sets.
  2. Click New to create a new Variable Set.
  3. Add a name, right-click the header, and Save the form.
  4. Under the Variables tab, click New to create a new variable set.
  5. On the Type field, choose Single Line Test.
  6. Under the Question tab, enter a question and name.
  7. Right-click the header and Save the form.
  8. Create an OnLoad Catalog Client Script to Hide the variable from the variable set:

    function onLoad()
    //Type appropriate comment here, and begin script below
    g_form.setVisible('testVS', false);

  9. Open record producer Emergency Change:
  10. In the Related Links section under the Variable Sets tab, add the newly created variable to the record producer.
  11. Right-click the header and Save the form.
  12. Click the Try It button and note that the variable set is hidden:

  13. From the Service Portal home page, navigate to Service Catalog > Can We Help You? > Emergency Change and note that the variable set is displayed on the form. This expected behavior is the same outside of Service Portal; however, setVisible does not work in Service Portal: 


This issue is under review. If you are able to upgrade, check the Fixed In field below to determine the versions that have a permanent fix. You can also subscribe to this known error article (click the Subscribe button at the top of the article) to receive notifications when more information is available about this issue.

Related Problem: PRB901828

Seen In

There is no data to report.

Fixed In


Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-05-21 11:40:02