Hide Variable set if Catalog Item field called Drop ship is true

Jason Rooney
Tera Contributor

Team

I need your help!

How do I do the following?

  1. On Catalog Item I have field Called Drop ship (check box)-  If this field is False I need the ability to hide & not mandatory an entire Variable Set - if true show VS
  2. On Catalog Item I have field Called Drop ship (check box)-  If this field true - Hide One field out of Variable set

Thanks in Advance!

Hope to see you @Knowledge 2025 - I will be sporting my Knowlege 24 backpack!

Say hi

--Jason

2 REPLIES 2

Sandeep Rajput
Tera Patron
Tera Patron

@Jason Rooney This can be implemented using following steps.

1. Define a check box variable inside your variable set and hide it using a UI Policy

2. Create another UI Policy  and in the trigger condition check if the value of checkbox variable created in step 1 is true. Set reverse if false check box to true.

3. Add UI Policy action for UI Policy created in step 2 to hide all the variables of variables set

4. Add an onLoad script in the variable set and make a GlideAjax call to a server side script include. This script include will make a glide record query to sc_cat_item table. Fetch the status of Drop ship status flag and pass it back to client script.

5. In client script response callback set the checkbox variable (created in step 1) to true/false depending up on the response received in callback.

6. UI Policy will trigger to show/hide variable set variable when the value of checkbox is set to true/false.

ghzelmed
Tera Contributor

Hello,

Here's how you can achieve your requirements clearly and step-by-step:

First Requirement: Show/Hide an Entire Variable Set

To handle visibility and mandatory settings for all variables within a Variable Set (VS), you'll need to use a Container. Place a Container Start before your variable set and a Container End after it.

For example, if your variable set "additional information" has an order of 130, you should:

  • Add a Container Start with order 125.
  • Add a Container End with order 140.

See this screenshot for clarification: ![Variable Set Order](variable set order.png)

variable set order.png

 

Now, create a UI Policy that triggers when your "Drop ship" checkbox is false. Apply a UI Policy Action on the container (e.g., named vs_container) to hide and set it as not mandatory when the checkbox is unchecked.

Here’s the UI Policy setup (make sure you keep the option "Reverse if false" checked): ![UI Policy Configuration](config ui policy.png)

config ui policy.png

Second Requirement: Hide One Specific Field Within the Variable Set

To hide only one specific variable within your variable set, create another UI Policy Action targeting just that specific variable (e.g., select_drop_ship).

Working Example

  • Checkbox unchecked: Only the specific field (select_drop_ship) is visible. ![Checkbox False](checkbox false.png)

checkbox false.png

 

  • Checkbox checked: Entire variable set along with the contained variables becomes visible. ![Checkbox True](checkbox true.png)  checkbox true.png

     

If you find this explanation helpful, please mark it as the correct answer.

Thank you!