Somehow I am not getting it.
I have created a Taxonomy of Organizations. I have then added a custom required field to my User accounts call "Organization". I would like to create a view where the currently logged in user can only see a list of people that belongs to the same Organization as the currently logged in user and no others.
I have created the view just fine, and the list of users appears fine, but I cannot get the filtering and relationships to only show me the only the users that belong to the same Organization as the currently logged in user.
I could do this in SQL in like 2 seconds, but for some reason I am not getting how to do it in the Drupal interface.
I am running Drupal 8.
Add a contextual filter
User ID
(to get the current user)Add a relationship
Taxonomy term referenced from field_organization
(to get the taxonomy term referenced by current user)Add a relationship
User using field_organization
(to get the users referencing to the Organization taxonomy at step 2)Change the relationship of all fields to
field_organization
If you want to exclude the current user from the results, add another contextual filter
User ID
withfield_organization
relationship Remember to scroll down and check theExclude