Variable needs to visible in catalog item and the same variable do not visible in Orderguide

Servicenow de11
Tera Contributor

Hello,

 

I am having a requirement that is We have a variable 'Requested for user' needs to visible in the catalog item. The same catalog item we have have added in rule base order guide. In that oder guide the same variable ''Requested for user" needs to visible false. How to achieve this requirement.?Can anyone help me on this.

Thanks in advance.

 

Regards

1 ACCEPTED SOLUTION

RAMANA MURTHY G
Mega Sage
Mega Sage

Hello @Servicenow de11 ,

In the variable editor, we can find Availability tab, you can just uncheck Visible on Guides option for you Requested for user, and you will not be see this variable on Order Guides

for reference please find the screen shot

RAMANAMURTHYG_0-1727955619916.png

 

Please mark my answer helpful  & correct if it helps you
Thank you

G Ramana Murthy
ServiceNow Developer

View solution in original post

2 REPLIES 2

RAMANA MURTHY G
Mega Sage
Mega Sage

Hello @Servicenow de11 ,

In the variable editor, we can find Availability tab, you can just uncheck Visible on Guides option for you Requested for user, and you will not be see this variable on Order Guides

for reference please find the screen shot

RAMANAMURTHYG_0-1727955619916.png

 

Please mark my answer helpful  & correct if it helps you
Thank you

G Ramana Murthy
ServiceNow Developer

Chetna_dev
Kilo Sage

To achieve the requirement where the "Requested for user" variable is visible in a catalog item but hidden in the associated order guide, you can use a combination of UI policies and script logic in ServiceNow. Here’s a step-by-step approach:

Step 1: Create the Catalog Item Variable

  1. Create the Variable:
    • Go to the catalog item and ensure you have a variable named "Requested for user."

Step 2: Create a UI Policy for the Order Guide

 

  • Navigate to UI Policies:

    • Go to Service Catalog > Catalog Policy > UI Policies.
  • Create a New UI Policy:

    • Click on "New" to create a new UI policy.
    • Set the Table to the relevant Order Guide (e.g., sc_cat_item).
    • Set the Short Description to something like "Hide Requested for User in Order Guide."
  • Set Conditions:

    • Use conditions to check if the current catalog item is part of the order guide. For example:
      • Condition: current.catalog_order_guide == true (you may need to adjust this based on your setup).
  1. UI Policy Actions:

    • In the UI Policy Actions tab, add an action to set the visibility of the variable:
      • Variable Name: "Requested for user"
      • Visible: false
  2. Save the UI Policy.

Step 3: Test the Implementation

  1. Test the Catalog Item:

    • Open the catalog item directly and verify that the "Requested for user" variable is visible.
  2. Test the Order Guide:

    • Open the order guide that includes the catalog item and confirm that the "Requested for user" variable is hidden.

if you found this helpful please accept as solution and mark helpful

best

Chetna