Set Default value and hide Service Catalog Variable based on condition

Bianca1
Giga Contributor

Follow up from: Add Advanced Reference Qualifier to Variable Set that is dependent on a Catalog Item field

In a Service Catalog(shown below) I am trying set a default value on the Product field when their is only one option from the reference table. I would also like to hide this variable or set it as a read-only field with the default option.

I have already added a reference qualifier(follow up link) to that field which will filter how many options are show. If there is more than one option, I want to do nothing.

find_real_file.png

I have been playing around with Business rules, Client Scripts and UI Policies, but none have been successful. Can anyone point me in the direct of the right script to write? 

Thank you.

1 ACCEPTED SOLUTION

I think it needs to be an onChange client script using GlideAjax to query the server, and if the result set has only one member, then return that member, else, do nothing.

View solution in original post

12 REPLIES 12

Please remove initialize function from SI and give it a try.
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022

That worked, thank you!

Awesome.
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022