Map the variables of one catalog item in another

SS1510
Tera Contributor

I have an order guide in which 2 catalog items are there. In one catalog item there are some variables which are not in 2nd catalog item. so when submitting the order guide , those variables should be visible in RITM and SCTASK on 2nd catalog item. How to do this

5 REPLIES 5

Hi @SS1510 ,

 

you are correct. The default behavior of cascading variables requires the variables to be present on the first "Describe Needs" page of the order guide to collect their values. However, you can use a Catalog Client Script to hide the variables on the initial page while still allowing the values to be passed.

 

Can you refer: https://www.servicenow.com/community/developer-forum/hiding-order-guide-cascading-variables-on-deskt...

 

Somewhat it should look like below

Write the onLoad Catalog client script:

  • Uncheck the Isolate Script box to ensure it can access the page content. This is crucial for Service Portal.
  • Enter the following code. It checks if the current_guide parameter matches the current_item parameter, which is only true on the first page. 
 
javascript
function onLoad() {
  // Get a reference to the current item and guide
  var item = g_form.getUniqueValue();
  var guide = g_form.getParameter('sysparm_guide');

  // Check if we are on the first page of the order guide
  if (item && guide && item == guide) {
    // Replace 'variable_set_name' with the actual name of your variable set    g_form.setDisplay('variable_set_name', false);
  }
}

 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

 

Thanks, GP