How to create a Order Guide Rule Base checking for selected values in a list collector variable?

diegosantiago
Kilo Expert

I'm trying to figure out how to check if any of these systems are selected on this list collector.

When you zBoot an instance with demo data, there is an example order guide built, that uses an "Like" operator to check if a sys_id is selected on the List Collector, but even creating a copy of this order guide, I cannot use this "Like" operator.

Any ideas?

1 ACCEPTED SOLUTION

diegosantiago
Kilo Expert

Workaround to add contains operator:



function onLoad() {


      var checkExist = setInterval(function() {


              if ($('oper') != undefined) {


                      var found = false;


                      var select = $('oper').down(0);


                      for (var i = 0; i < select.options.length; i++) {


                              if (select.options[i].value == 'LIKE') {


                                      found = true;


                              }


                      }


                      if (found == false) {


                              console.log('contains added');


                              $('oper').down(0).insert({


                                      top: '<option value="LIKE">contains</option>'


                              });


                      }


              }


      }, 1000);


}


View solution in original post

4 REPLIES 4

Matt Small1
Tera Expert

If you are talking about the Rule Base operators then you are looking for the 'contains'   condition.     Your condition would be something like -



[variable]   contains [sys_id of referenced table]


Yes, I'm talking about the Rule Base operators, but actually I cannot use the "contains".


Capturar.PNG


It only has:



Is


Is Not


Is Empty


Is Not Empty


Less Than


Greater Than


Less Than or is


Greater Than or is


Hi Diego,



I believe that is a bug, or at least a "feature-incomplete" issue, when using a List Collector (slushbucket) variable and the Condition Builder.   I've run into that before and did not find a satisfactory response.   You can try to trick it by changing the variable type to something else (another variable type that allows for using "Contains"), setting up the condition, and then changing the variable type back. It may hold on to the value of the condition you've setup. (YMMV)



There are some inconsistencies with the way GlideLists are treated depending on where you are in the system (e.g., when using as a field vs. variable, when using in Wizards/Order Guides/Catalog vs. normal forms, etc.).   This is one sore-point I've had with the platform, but overall you won't see me walking away.  




Good luck,


-Brian


diegosantiago
Kilo Expert

Workaround to add contains operator:



function onLoad() {


      var checkExist = setInterval(function() {


              if ($('oper') != undefined) {


                      var found = false;


                      var select = $('oper').down(0);


                      for (var i = 0; i < select.options.length; i++) {


                              if (select.options[i].value == 'LIKE') {


                                      found = true;


                              }


                      }


                      if (found == false) {


                              console.log('contains added');


                              $('oper').down(0).insert({


                                      top: '<option value="LIKE">contains</option>'


                              });


                      }


              }


      }, 1000);


}