My application allows users to onboard their own applications by creating rules to dictate their configuration. These rules are created in a workflow and added to a table, so when they complete their process it will exist in a list like ["rule1', "rule2", "rule3", "rule4"]. We then want them to add a rule expression, to dictate how the configurations should be applied (i.e rule1 AND rule2 OR rule3 OR rule4 (always use rule1, use either rule2-4).

What the code does doesn't matter so much, it's how I want the user to enter this information. Right now I have just a text field for the user to write in rule1 AND rule2 OR rule3 OR rule4. I want it to be more intuitive though, and just having a textbox does not guide the user very well if they are new and not entirely sure what we are expecting. Also, We have to ensure the expression is in a proper format, so it would make validation easier if we can control what they enter. I've tried using dropdown boxes for this, but it didn't seem to be very visually appealing. Are there any other suggestions?


I personally like Google Scholar's approach: enter image description here

You could have similar, for example headers

  • use these rules always

  • use one of these rules

And then the user selects or writes the rules for both of the headers.

That would work at least for the example you gave, if there can be more complicated AND/OR combinations, maybe you could use AND/OR dropdowns like this:

enter image description here

In that case you need to ensure that the interpretation order is correct. For example in the use case you gave, [rule1 AND rule2 OR rule3 OR rule4] would most likely be interpreted as "Use rule1 and rule2, or use only rule3, or use only rule4". If you want it to mean "always use rule1, use either rule2-4", you should write [rule1 AND (rule2 OR rule3 OR rule4)] to avoid confusion. And somehow implement the parenthesis with the dropdowns.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.