0

I have a webform for students to select their teachers. The data displayed in Views to show the submitted values are the following:

----------------------------------
Instructor | student
----------------------------------
teacher A | student name A
teacher B | student name B
teacher A | student name C
teacher A | student name D
--------------------------------

When "teacher A" login, I am expecting "teacher A" can see all his students, without entering filter value "teacher A"

----------------------------------
Instructor | student
----------------------------------
teacher A | student name A
teacher A | student name C
teacher A | student name D
--------------------------------

I want to have something like automatic filter with the field "Instructor", not typing own name in the exposed filter. So every teacher can get his own students automatically in the table.

Is there any specific module to do that, or a way to get that?

1

if instructor is a user entity (or reference), you can add a contextual filter in your view for your field, like this:

contextual filter

|improve this answer|||||
  • The value Instructor is from the select option list (list of instructors). – Waluyo Adi Siswanto Jun 8 '15 at 4:56
  • ok - cannot imagine what you mean by select option list, but this seems to be the field you want to filter. for the filter you want to use the actual user - right ? – rémy Jun 11 '15 at 15:16
  • Yes that is the field user wants to filter using his name (contain the user name). The values of field to filter are webform submitted data (select option component) submitted by other users. – Waluyo Adi Siswanto Jun 11 '15 at 22:50
  • Yes that is the field that instructor user wants to filter using his name (contain the name). The values of field to filter are webform submitted data (manually defined in webform select option component) submitted by student users. – Waluyo Adi Siswanto Jun 11 '15 at 22:57
  • so - are you able to make a contextual filter for this field ? – rémy Jun 13 '15 at 15:13

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.