Answers.Body: <p>To create a Drupal relationship in a View for contacts A - B or B - A you need to add 2x Drupal relationship.</p>
  
  <p>In the case of starting with the Org assuming it as at the B end of the relationship, first you choose the option that says </p>
  
  <ul>
  <li>CiviCRM Contacts: CiviCRM Relationship (starting from Contact B)</li>
  </ul>
  
  <p>and configure that with the relevant Relationship Type</p>
  
  <p>Then you choose</p>
  
  <ul>
  <li>CiviCRM Relationships: Contact ID A</li>
  </ul>
  
  <p>and use the relationship you created above to Join contact A via the relationship to contact B.</p>
  
  <p>Then as Laryn says, select a field for DisplayName and tell it to use the second of these relationships (probably only one that shows in that context) and bingo!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-12T06:05:33.947Z
Answers.Text: Thanks. after some fiddling and reversing the logic above, I now have it displaying Organisation Name and Contact name.
  
  But I cant seem to add a filter to allow the user to then filter the results to only a particular Organisation.   Looking at the filters the CiviCRM Contacts: Organisation  field is not in the list.
  
  Also, how can I make that filter then display all the organisations rather than the user having to type in a name?
Answers.UserDisplayName: DMOZ
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-12T07:32:12.577Z
Answers.Text: Filter should allow you to add Display Name, and again select the Relationship to tell the filter to be applying to the Contact B v A (or vv)
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-13T02:06:00.880Z
Answers.Text: yes, I can select Display Name in the filters option.
  2x Issues:: 
  1. I want to filter on the Contacts - Organisation Name, but even with a basic view which simply displays contacts as a list in the view the Organisation Name field doesnt seem to be exposed to views.  So this feels like a bug??   
  2. Having created a filter, is there a way to have the filter values displayed via a drop-down style option.  eg Can you have  a drop-down filter selector which is pre-populated from all (unique) CiviCRM Address: State/Province values?  I can only see that you can have a typed in field value
Answers.UserDisplayName: DMOZ
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-13T04:52:09.440Z
Answers.Text: want to skype me? it may be much easier to point at something to clarify at this point peter.davis59 also much better if you break those out as new questions if the skype doesn't sort it
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-13T23:18:51.720Z
Answers.Text: I've sent you a skype contact request
Answers.UserDisplayName: DMOZ
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-13T23:48:47.300Z
Answers.Text: Peter fixed my issue and was very helpful
Answers.UserDisplayName: DMOZ
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-13T23:50:03.830Z
Answers.Text: btw i would break the 'how to make eg Display Name work as an autocomplete filter in Views' as a new question. i can't recall if we got it sorted but it would be a good one to get working ;-)
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-12T02:20:06.647Z
Answers.LastActivityDate: 2016-05-12T02:20:06.647Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>to all that may come across this</p>
  
  <p>After putting my CiviCRM project on hold for a few months I came back to it having found no other better solutions to my needs and came across this</p>
  
  <p><a href="https://civicrm.stackexchange.com/questions/8623/drupal-views-sorting-of-family-members-in-a-contact-list">Drupal Views - Sorting of family members in a contact list</a></p>
  
  <p>which has images and step-by-step guide and got my view returning what I need for the moment..... next is getting it to display the View on the main site.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-15T11:00:08.847Z
Answers.LastActivityDate: 2016-08-15T11:00:08.847Z
Answers.LastEditDate: 2017-04-13T12:53:13.017Z
Answers.UserDisplayName: DMOZ
Answers.Body: <p>Once you have the relationship in place, you should be able to add a new field to the view (e.g. "Display Name") and in the settings for this field, tell it to use that relationship that you've set up.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-12T00:11:33.980Z
Answers.LastActivityDate: 2016-05-12T00:11:33.980Z
Answers.UserDisplayName: Laryn
Body: <p>I have been trying to work out how to create a Drupal View to allow end users to select an Organisation and then it displays Contacts given a specific relationship type.
  eg Select Employer Name (Organisation) - display Employees of Employer
  Relationship is the built-in Employer of / Employee Of</p>
  
  <p>So far I have created a view with CiviCRM:Contact type and added a few fields, but the only 'relationship' details i can retrieve that is close for the 'employees' side of things is "CiviCRM Relationships: Contact ID B (Contact ID B)".  I dont see to have or can find a method to display Contact B's Display Name</p>
  
  <p>Example - Selected organisation is Contact 'A' ID 203 'K&amp;N Brass' and has a relationship to Contact 'B' who's ID=202</p>
  
  <pre><code>Contact ID  Display Name    Relationship Type A-to-B    Contact ID B
  203         K&amp;N Brass       Band includes member        202
  </code></pre>
  
  <p>Drupal 7.43
  CiviCrm 4.7.7
  Views: 7.x-3.13</p>
  
Tags: <drupal-views>
Title: Use Drupal Views to select Organisation and display contacts with a particular relationship to Organisation
ThreadText: # Use Drupal Views to select Organisation and display contacts with a particular relationship to Organisation
  
  (Asked by: username_0 on 2016-05-12)
  
  I have been trying to work out how to create a Drupal View to allow end users to select an Organisation and then it displays Contacts given a specific relationship type.
  eg Select Employer Name (Organisation) - display Employees of Employer
  Relationship is the built-in Employer of / Employee Of
  
  So far I have created a view with CiviCRM:Contact type and added a few fields, but the only 'relationship' details i can retrieve that is close for the 'employees' side of things is "CiviCRM Relationships: Contact ID B (Contact ID B)". I dont see to have or can find a method to display Contact B's Display Name
  
  Example - Selected organisation is Contact 'A' ID 203 'K&N Brass' and has a relationship to Contact 'B' who's ID=202
  
  ```
  Contact ID  Display Name    Relationship Type A-to-B    Contact ID B
  203         K&N Brass       Band includes member        202
  
  ```
  
  Drupal 7.43
  CiviCrm 4.7.7
  Views: 7.x-3.13
  
  **Tags:** drupal-views
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2016-05-12. Score: 6 | Accepted answer
  
  To create a Drupal relationship in a View for contacts A - B or B - A you need to add 2x Drupal relationship.
  
  In the case of starting with the Org assuming it as at the B end of the relationship, first you choose the option that says
  
  * CiviCRM Contacts: CiviCRM Relationship (starting from Contact B)
  
  and configure that with the relevant Relationship Type
  
  Then you choose
  
  * CiviCRM Relationships: Contact ID A
  
  and use the relationship you created above to Join contact A via the relationship to contact B.
  
  Then as username_2 says, select a field for DisplayName and tell it to use the second of these relationships (probably only one that shows in that context) and bingo!
  
  > **Comments:**
  > **username_0**: Thanks. after some fiddling and reversing the logic above, I now have it displaying Organisation Name and Contact name.  But I cant seem to add a filter to allow the user to then filter the results to only a particular Organisation.   Looking at the filters the CiviCRM Contacts: Organisation  field is not in the list.  Also, how can I make that filter then display all the organisations rather than the user having to type in a name?  
  > **username_1**: Filter should allow you to add Display Name, and again select the Relationship to tell the filter to be applying to the Contact B v A (or vv)  
  > **username_0**: yes, I can select Display Name in the filters option. 2x Issues::  1. I want to filter on the Contacts - Organisation Name, but even with a basic view which simply displays contacts as a list in the view the Organisation Name field doesnt seem to be exposed to views.  So this feels like a bug??    2. Having created a filter, is there a way to have the filter values displayed via a drop-down style option.  eg Can you have  a drop-down filter selector which is pre-populated from all (unique) CiviCRM Address: State/Province values?  I can only see that you can have a typed in field value  
  > **username_1**: want to skype me? it may be much easier to point at something to clarify at this point peter.davis59 also much better if you break those out as new questions if the skype doesn't sort it  
  > **username_0**: I've sent you a skype contact request  
  > **username_0**: Peter fixed my issue and was very helpful  
  > **username_1**: btw i would break the 'how to make eg Display Name work as an autocomplete filter in Views' as a new question. i can't recall if we got it sorted but it would be a good one to get working ;-)  
  
  ---
  
  ### Answer by username_0 on 2016-08-15. Score: 1
  
  to all that may come across this
  
  After putting my CiviCRM project on hold for a few months I came back to it having found no other better solutions to my needs and came across this
  
  [Drupal Views - Sorting of family members in a contact list](https://civicrm.stackexchange.com/questions/8623/drupal-views-sorting-of-family-members-in-a-contact-list)
  
  which has images and step-by-step guide and got my view returning what I need for the moment..... next is getting it to display the View on the main site.
  
  
  ---
  
  ### Answer by username_2 on 2016-05-12. Score: 1
  
  Once you have the relationship in place, you should be able to add a new field to the view (e.g. "Display Name") and in the settings for this field, tell it to use that relationship that you've set up.
  
  
  ---
  
  