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

Vishal Khandve
Kilo Sage

Hi,

Please make the variable sets variable (field) non mandatory. Make them mandatory using UI policy.

Also check for applies to field while creating UI policy.

find_real_file.png

 

Thanks,

Vishal Khandve

Will this not make the variable none mandatory for all other items? I still want this one to be mandatory on other catalogue items.

 

Sagar Pagar
Tera Patron

Hi,

You need not to create 2 different UI policies, as you created 1st UI policy which correct.

 

Catalog condition: Variable is Option 2

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

Type: onload & onchange

Reverse if false checkbox: true

 

After submit the request/order which error displays, can you share the screenshots.

 

Regards,

Sagar Pagar

The world works with ServiceNow

Sorry there was actually 3 variable sets not 2 and they are all on the one UI policy. I don't actually get an error when I submit the form it just says submitting for a few seconds and then does nothing.

This is what my UI Policy looks like.