Answers.Body: <p>Also note that if you are using custom fields in your views you have to check the permission Access all custom data. For all people using views. If drupal cache is cleared the views are rebuild based upon the role the user who is clearing the cache, meaning that the custom field permission will be checked against that user. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-11T07:13:33.940Z
Answers.LastActivityDate: 2015-05-11T07:13:33.940Z
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Answers.Body: <p>It is the regular Drupal Views module, but if you have Drupal and CiviCRM in separate databases, you have to edit your settings file to let Views know where to find the CiviCRM data. (Coleman notes in addition: <em>"if your drupal sql user and civicrm sql user are different then you need to grant SELECT privileges to the drupal one for the civi db."</em>) You can find the information you need to add to settings.php at <strong>Administer > System Settings > CMS Database Integration</strong>.</p>
  
  <p><a href="http://wiki.civicrm.org/confluence/display/CRMDOC/Views3+Integration" rel="noreferrer">The wiki page has a pretty good tutorial on how to get Views working</a>.</p>
  
  <p>Then you can use default Views functionality on CiviCRM data -- for example:</p>
  
  <ul>
  <li>set up a View for CiviCRM Participants, </li>
  <li>turn on Views aggregation, </li>
  <li>add the Event Title field (Aggregation settings: Group together)</li>
  <li>add the Participant ID field (Aggregation settings: Count)</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-08T20:53:12.777Z
Answers.Text: Thanks - you've been a great help.  I now have a nice little block with a table showing the number of registrants for all my upcoming events.
Answers.UserDisplayName: tmccartney
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-08T21:29:36.413Z
Answers.Text: @tmccartney Don't forget to mark this answer as correct with the checkmark please!
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-10T21:22:07.267Z
Answers.Text: If this answer gets 'accepted' can you edit it to make reference to fact that the instructions only apply if civi is in a separate DB - as per coleman's answer - no need to confuse people who have Drupal and civi in same db ;-)
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-08T18:24:49.797Z
Answers.LastActivityDate: 2015-05-12T14:38:23.893Z
Answers.LastEditDate: 2015-05-12T14:38:23.893Z
Answers.UserDisplayName: Laryn
Answers.Body: <p>CiviCRM ships with a bundled module for Views 3 integration, all you have to do is turn it on.</p>
  
  <p>If you are using a separate db for Civi, you'll also need to follow the instructions at <strong>Administer > System Settings > CMS Database Integration</strong>. Note that if your drupal sql user and civicrm sql user are different then you need to grant SELECT privileges to the drupal one for the civi db.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-09T20:17:51.693Z
Answers.LastActivityDate: 2015-05-09T20:17:51.693Z
Answers.UserDisplayName: Coleman
Body: <p>Can someone tell me what I need to use Views with CiviCRM?  Is it the regular Drupal Views module with another module that provides integration?</p>
  
  <p>Also, how would I use Views to display a count of how many people are registered for each of my events?</p>
  
Tags: <civievent><drupal><drupal-views>
Title: How do I use Views with CiviCRM?
ThreadText: # How do I use Views with CiviCRM?
  
  (Asked by: username_0 on 2015-05-08)
  
  Can someone tell me what I need to use Views with CiviCRM? Is it the regular Drupal Views module with another module that provides integration?
  
  Also, how would I use Views to display a count of how many people are registered for each of my events?
  
  **Tags:** civievent, drupal, drupal-views
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2015-05-11. Score: 2 | Accepted answer
  
  Also note that if you are using custom fields in your views you have to check the permission Access all custom data. For all people using views. If drupal cache is cleared the views are rebuild based upon the role the user who is clearing the cache, meaning that the custom field permission will be checked against that user.
  
  
  ---
  
  ### Answer by username_2 on 2015-05-08. Score: 12
  
  It is the regular Drupal Views module, but if you have Drupal and CiviCRM in separate databases, you have to edit your settings file to let Views know where to find the CiviCRM data. (username_5 notes in addition: *"if your drupal sql user and civicrm sql user are different then you need to grant SELECT privileges to the drupal one for the civi db."*) You can find the information you need to add to settings.php at **Administer > System Settings > CMS Database Integration**.
  
  [The wiki page has a pretty good tutorial on how to get Views working](http://wiki.civicrm.org/confluence/display/CRMDOC/Views3+Integration).
  
  Then you can use default Views functionality on CiviCRM data -- for example:
  
  * set up a View for CiviCRM Participants,
  * turn on Views aggregation,
  * add the Event Title field (Aggregation settings: Group together)
  * add the Participant ID field (Aggregation settings: Count)
  
  > **Comments:**
  > **username_0**: Thanks - you've been a great help.  I now have a nice little block with a table showing the number of registrants for all my upcoming events.  
  > **username_3**: @username_0 Don't forget to mark this answer as correct with the checkmark please!  
  > **username_4**: If this answer gets 'accepted' can you edit it to make reference to fact that the instructions only apply if civi is in a separate DB - as per coleman's answer - no need to confuse people who have Drupal and civi in same db ;-)  
  
  ---
  
  ### Answer by username_5 on 2015-05-09. Score: 3
  
  CiviCRM ships with a bundled module for Views 3 integration, all you have to do is turn it on.
  
  If you are using a separate db for Civi, you'll also need to follow the instructions at **Administer > System Settings > CMS Database Integration**. Note that if your drupal sql user and civicrm sql user are different then you need to grant SELECT privileges to the drupal one for the civi db.
  
  
  ---
  
  