3

How to do I create a filter on my view that filters based on the value of one field being equal to the name of the currently logged in user? The field is static.

  • Can you describe the question little bit more. What i understood you want to show a list of records/record based on user login. – DRUPWAY Feb 10 '17 at 9:30
  • As per my assumption I believe you can achieve using contextual filter. – DRUPWAY Feb 10 '17 at 9:36
2

You can use contextual filter as suggested by @Smalution. Go to your view click on add Contextual filter on right side of it, then select the field you want to use as a filter and do as shown in below image:

enter image description here

To use with name try this:

enter image description here

  • That is a UID not a User Name. Is it possible to get user name? – Sam Feb 13 '17 at 6:51
  • @Sam I have updated my answer. – Anil Feb 13 '17 at 12:58
1

In view Relationships add "author" then in FILTER CRITERIA Add (User: Current) and select (yes) in "Is the logged in user"..

  • Hi @a.alshamiri, please try not to provide one-sentence answers. If possible provide a step-by-step guide with screenshots of each step, or of the final configuration screen. Thanks! – Wim Mostrey Feb 13 '17 at 15:29
  • But the field I want to match isn't author. – Sam Feb 13 '17 at 16:23

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.