Remove Dependent Catalog Items in Order Guide Based on Selections

jmiskey
Kilo Sage

I have an Order Guide that I am using on the Service Portal.  It has a lot of Variable Sets and Catalog Items.  My main Order Guide has a few List Collectors.

List Collector #1 is the initially the only one visible.  Based on the values selected in it, List Collector #2 and List Collector #3 may or may not be displayed (they are initially hidden through Catalog UI Policies).  Then, based on the selections made in List Collector #2 and List Collector #3, specific Catalog Items are displayed (via Rules Base conditions).

The issue that we are having is the following.  Let's say that we made a bunch of selections, and made some errors.  So after we have made selections in List Collectors #2 and/or #3, if we then remove them, it (correctly) also removes those Catalog Items from view.  However, if the person instead decides to remove the item from List Collector #1, it will hide the appropriate List Collector #2 or List Collector #3 box, but does not hide/remove the matching Catalog Item.

So, I am trying to figure out a way to do that.  I was thinking maybe trying to do something with a Catalog Client Script, but I am having issues getting that to work (I thought maybe doing an onChange of List Collector #1), and checking to see if List Collector #2 and List Collector #3 and hidden, and if they are, be sure to clear out their values.  But I could not get that to work.

Any ideas?

Thanks

 

1 ACCEPTED SOLUTION

You should just need to paste the line of code in the 'Execute if false' field of the 'Scripts' section of the UI policy.  If the UI policy returns false, the field will be hidden, made optional, and cleared.  Just make sure 'Run scripts' is checked and 'Run scripts in UI type' is set to 'All'.

View solution in original post

7 REPLIES 7

You should just need to paste the line of code in the 'Execute if false' field of the 'Scripts' section of the UI policy.  If the UI policy returns false, the field will be hidden, made optional, and cleared.  Just make sure 'Run scripts' is checked and 'Run scripts in UI type' is set to 'All'.

Brilliant!  That works perfectly.  Thank you very much!

I had forgotten about that "Execute if false" option.

No problem.  Please mark the answer above as correct if it's solved your problem.