Override Variable Set mandatory field on a specific Catalog Item without touching the Variable Set

vivek11
Tera Contributor

Hi community,

I have a specific Catalog Item that includes two Variable Sets: "software" and "business justification".
The variable inside the "business justification" Variable Set is set to mandatory. I need to make this variable non-mandatory (optional), but only for this one specific Catalog Item. Crucially, I cannot modify either of the Variable Sets or their existing configurations.
What I have tried (and has NOT worked):
1. onSubmit Client Script: Tried using g_form.setMandatory on the Catalog Item, but native validation blocks the submission before it completes.
2. onLoad Client Script: Created an onLoad script on the Catalog Item to set mandatory to false. The field still shows as mandatory.
3. Catalog UI Policy: Created an item-level UI Policy (with no conditions) to set the variable to Mandatory = False. It still remains mandatory on the form.
It seems the Variable Set's configuration is strictly overriding my Catalog Item-level attempts. How can I force this variable to be optional without touching the Variable Set itself? Any advice is appreciated!


Thank you

3 REPLIES 3

vaishali231
Mega Sage

Hey @vivek11 
Could you please confirm whether the variable is marked as mandatory in its configuration, or if it’s being made mandatory through a UI Policy or Client Script in the Variable Set? 

Vishal Jaswal
Tera Sage

Hello @vivek11 

If you have configured the variable to mandatory, then it is not possible.


Hope that helps!

Rakesh_M
Mega Sage

Hi @vivek11 ,

Your approach 3 should work with a small change: give the Catalog UI Policy a higher order.

I tested this by creating three variables in a Variable Set:

  • Var 1: Mandatory by default.

  • Var 2: Made mandatory through a UI Policy.

  • Var 3: Made mandatory through a Client Script.

In my testing, a Catalog UI Policy with a higher order successfully made all 3 variables non-mandatory.


When the form loads, all applicable UI policies (from the Variable Set and from the Catalog Item) run in ascending Order. If two of them act on the same variable, the one that runs last wins. If your item-level policy has a lower or equal Order, the Variable Set’s configuration is applied after it and makes the variable mandatory again. That is probably why your policy appeared to have no effect.