Views: Trying to filter content by two field values (either/or)? I'm trying to filter published content by the values set inside of two fields (one or the other). Right now, I'm successfully filtering my content by one field:

Contextual Filter


  If field_targetuser = logged in uid, than display content.


However, I also want to show content in which field_universal = YES , regardless of the logged in uid.

Naturally, implementing the first Contextual Filter and than a second only further filters the intial filter. What I'm trying to accomplish:


  Show all content of this type if targetuser matches logged in user id,
  but ALSO show all content where field_universal = YES, regardless of what appears in the targetuser id.


Views setup:
You can solve this without any additional modules or coding, just with pure Views + Entity Reference. Here is how:


You need to add 1 more relationship to your current View (looking at your screenshot):


Entity Reference: Targeted User => This is the Entity Reference field that points to a User, what you call "targetuser"

You need to add a "User: Current" filter to your view. Once you click on that, you should see the following:

This filter will allow you to select only the nodes where the targeteduser is the same as the logged-in (current) user.
You need to place the universalswap in an OR relationship to the new filter inside a FILTER GROUP. Then place that group in an AND relationship to the rest of your filters, i.e. Type = Messages.


That should do it without any additional modules.
Here is a screenshot of my final View configuration:

I am logged in as admin (uid:1) and you can see in the results that I am getting all messages that are either "Universal" or targeted at me.

Good luck!