Mandatory field in variable set impacting UI policy

riskay123
Mega Guru

I have a catalog item that contains several variables and two mandatory variable sets.

I have a UI Policy for the catalog item that hides these variable sets on the form unless option 2 condition is met on one of the variables.

If option 2 is selected on the variable and I submit the form it submits without issue. If option 1 is selected the variable sets do not display which is correct. However, when I try to submit the form it says Submitting but then it doesn’t go any further. It does not create the request. I am assuming this has something to do with the fact that the variable sets are mandatory because if I select option 1 and then populate the variable sets and then change the option back to option 2 the field then disappear as expected and I can submit the request.

UI Policy Details

Catalog condition is Variable is Option 2

Catalog UI Policy Actions are Read Only=Leave alone, Mandatory = True and Visible = True

 

I also tried changing the UI Policy Details to

Catalogue condition  is Variable is Option 1

Catalog UI Policy Actions are Read Only = Leave Along, Mandatory = False and Visible is False

Didn’t make any difference

9 REPLIES 9

Shrutika Surwad
Kilo Guru

Hey there,

 

when you are making variable set mandatory using catalog UI policy make sure you select applies to catalog item not variable set.

 

best practice for catalog item in this case is whenever you want to make any field mandatory, read only on visibility always go for Catalog UI policy

 

 

also check for catalog client script are they making  any field mandatory.

 

Thanks,

Shrutika

 

Hi,

This is applied on the catalog item. I checked the catalog client script and it doesn't appear to reference "mandatory" in the script but I am not a coder. 

 

Hey one more thing

if any variable from variable set is mandatory and you are applying any UI policy there then it will create issue again.

do check this also

riskay123
Mega Guru

Thanks for your help everyone. I logged it with Service Now because no matter what I tried I couldn't get it to work. Turns out that once of the variable sets had a script that was impacting the way the UI policy was working. 

 

 

Hi @riskay123 

 

Did you found the way for this? Actually I have the requirement where I wants to hide my two variable sets on Portal view but not in catalog task.

I have mandatory variables under that variable sets.