Show content whose "team" field matches the user "team" field The users on my site all have a field named &quot;team&quot; and my content types also have the same field.
I want to create a views page that shows all nodes where that &quot;team&quot; field equals the same field on the user node.
Example:
USERS:
user1, team: team1
user2, team: team1
user3, team: team2

NODES:
node1, team: team2
node2, team: team1
node3, team: team1

When I'm logged in as user 3, I want my view to show node 1.
I know that I have to work with the contextual filters and context but I'm unable to get the output I need.
The easiest way to set this up is through the Content: Has taxonomy term ID Contextual filter.

In Content Views listing your nodes add that Contextual filter and set it up:
When the filter value is NOT available
Provide default value
Taxonomy term ID from URL
Load default filter from node page, that's good for related taxonomy blocks
Filter to items that share any term
When the filter value IS available or a default is provided
Specify validation criteria
Taxonomy term
[your vocabulary]
Term ID
Adjust the other option as necessary.
Now if you enter some taxonomy term ID into the Views Preview field, it will be picked up by the Contextual filter and show only nodes that have been tagged with that term.

Create a block Display and place your block in a region shown on entities that have the taxonomy term ID chosen. The block will show all nodes that share the term.


In your case if you place that block on User Profile pages, it will show the nodes related through the same Taxonomy term.

If you want to show that Block anywhere on the site, and have it take the Context of the currently logged in user you have to approach it a bit differently.
There may be more ways on how to achieve this, here's one:

In the original Views where you show a list of nodes add a Relationship for the Taxonomy term field (Field: Team).
Then add another Relationship that is reverse, going from Taxonomy term to the field on Users (Taxonomy term: User using …). This is where the term matching is done, the second Relationship will use the first one. This introduces the User info into your content Views.
Then add the Contextual filter for User ID (User Uid), it will use the second Relationship. Set up the Contextual to use the logged in user context:
When the filter value is NOT available
Provide default value
User ID from logged in user
When the filter value IS available or a default is provided
Specify validation criteria
User ID
Single ID
Place the Block anywhere on the site and it will only show nodes related to the user that is currently logged in, even if you place it on user profiles and view other users profiles!