targetUser is meant to collect the uid of a user that a current app
user is sending a message to
IMO the better approach would be to make targetUser an entity reference field.
For example: I named mine lalala (click picture below to enlarge)
- For Target Type, select User
- Number of Values: Unlimited (as you could send a message to multiple users)
Then add or edit a message node and start typing user name, you will see the name in the drop down, select it and save.
Use a comma
, to add other user account.
In your view
Result: you should get a view of all the nodes where the logged in user was referenced.
The autocomplete only allows by username, and not uid. E.g. posting 47
into this field isn't allowed?
Create a new USER view.
1) click on +Add
2) Select Entity Reference
3) Remove user:name and add user:uid
4) click on settings and checkmark uid (if you don't do this step, it won't let you save the view)
Go to your Content Type Messages manage fields and edit your entity reference field.
- At the bottom check mark ✓ Render Views filters as select list
- Change to mode to View and select your view.
Also, "logged in user id (uid)" isn't an option? Just (author) User:
You will need to create a CONTENT view and then add:
- Relationship of Referenced User
- Now since you have a relationship User: Uid becomes available as contextual filter