Intuitive interface for Composing Boolean Logic?

  • I'm interested to know how people have, or would construct an interface which simplifies constructing logical boolean conditions? (Yes, it's a database query builder) In my mind a bad interface has them typing lots of AND, NOT IN, OR keywords etc. Or else has a million combo boxes.

    I'm wondering if anyone has a good example I could glean ideas from? Or some suggestions?

    At the moment I'm considering a split screen with a grid for composing the query and a canvas to display a visual representation of the sets of conditions and how they overlap etc. Like a Venn Diagram. This still gives me a problem with the usability/intuitiveness of the controls on the grid.

    EDIT: I'm very interested in ideas which simplify it for less technical users. However, ideas for a version of the UI for advanced users are very helpful as well.

    Be careful of using the word 'intuitive'. In my experience there is no such thing. :) The 'best' solution for one person may be confusing for the next person.

    If it fits your situation, it can really help if the user can start with a set of examples. For instance, if I'm creating an e-mail filter, I could select a load of emails which should match it. From that it's a relatively simple task to suggest a starting point for the filter, which the user can fine-tune. You can also help the user in their editing process by showing live examples of which records match and which records don't.

    reviewing the answers below, I think one of the keys is replacing the nomenclature of AND/OR with ALL/ANY.

    Dvir, AND/OR is just the starting point. Moving aware from those terms is the essential first step.

  • Hisham

    Hisham Correct answer

    11 years ago

    See also iTunes 9 or later. It adds the ability to do "nested" AND / OR expressions, akin to how a programmer would do it with parenthesis:

    alt text

    Can `AND` and `OR` be combined with this interface? Or is it either "all ANDs" or "all ORs"?

    iTunes 11 has hidden the nested boolean logic somewhat; you must now Option-click the plus button.

    Although the UI is capable, I dont think of it as particular intuitive. Granted this is a very difficult requirement to make intuitive.

    We implemented this on our solution about 2 years ago. Even though it does work, the feedbacks we get is that it's a total hell to use. Still looking for an alternative...

    @FlorianF. did you ever come up with a better alternative?

    @ChristopherPadfield while some of the answers below are similar to the accepted one, some propose a different pattern. I would like to know which of below have been tried, and what the feedback is for a given context.

License under CC-BY-SA with attribution

Content dated before 7/24/2021 11:53 AM