4

I have a page that displays a set of records. The page has filter section to search records. enter image description here

currently the logical operator AND is applied between all the filter conditions. Now the requirement for including the OR operation has arisen. The user suggested to add a dropdown with AND,OR options next to Value dropdown. But the problem is operator precedence. If I am going to make the page to look like the image below, the user is definitely going to find it confusing and I am also not sure how to resolve this search. enter image description here

Please suggest me how I could make this UI to let the user select the operator precedence easily.

  • I think the UI is self explanatory. In your example it is Case 1 && (Case 2 || Case 3 || Case 4) There is only one way to interpret that. However user might want much complex combination of operators. Agree with the accepted solution – Sathya May 18 '17 at 12:29
4

I think in your situation using spacing to show groups would help understand the relation between elements. You could also add the functionality to drag elements around from a group to another and a remove button (this handlers could be placed on the left of each element permanent on touch devices or only on hover for mouse ones).

enter image description here

  • Good idea. I could apply the AND within a group. Between groups the user can select the operator(AND | OR ) they want. Please confirm my understanding is right. – Saranya May 18 '17 at 13:02
  • @Saranya yes, the idea is that between elements of the same group there is no need to display AND. In the buttons below, clicking AND would add an element to the last group, clicking OR would create an element in a new group. If you think there is need to create elements in "old" groups you could possibly include a button "Add a new element to this group" or similar. – Alvaro May 18 '17 at 13:07
  • @Saranya you are welcome; at least I hope it gives you some idea that helps you proceed with your scenario. – Alvaro May 18 '17 at 13:29
  • You should also consider allowing the user to add extra conditions in already completed groups – Sebastianb May 18 '17 at 15:20
  • @Sebastianb thanks, yes you are right, I was commenting that above but I'll include it in the answer. – Alvaro May 18 '17 at 15:22

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.