Answers.Body: <p>One approach would be to use the <a href="https://www.drupal.org/project/views_php" rel="nofollow">views_php</a> module to embed a civicrm_api3 call to find out if the event is full, then print the result into the view. E.g.</p>
  
  <pre><code>$event = civicrm_api3('Event', 'getsingle', array('return' =&gt; 'is_full', 'id' =&gt; $row-&gt;id));
  if (!empty($event['is_full']) {
    print "Event is full";
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-07T15:52:25.853Z
Answers.Text: You can get the is_full value from the event get api call and requesting "return.is_full" in the params
Answers.UserDisplayName: Donald Lobo
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-16T08:47:29.150Z
Answers.Text: Two years later is still one of the best solutions?
Answers.UserDisplayName: Francesc Bassas i Bullich
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-07T15:41:54.313Z
Answers.LastActivityDate: 2015-05-07T16:33:48.167Z
Answers.LastEditDate: 2015-05-07T16:33:48.167Z
Answers.UserDisplayName: Coleman
Answers.Body: <p>We have been using the module "views conditional" to do that. Here's how it works:</p>
  
  <ol>
  <li><p>install and enable the module "Views Conditional"</p></li>
  <li><p>enable the relationship <em>Event -> Participant</em> in the view</p></li>
  <li><p>activate aggregation in the view in order to count the number of
  participants (hide it if necessary)</p></li>
  <li><p>add the field to the view: <em>(Event -> Participant) COUNT(CiviCRM
  Participants: Participant ID)</em> (hide it if necessary)</p></li>
  <li><p>add the field to the view: <em>CiviCRM Events: Event Max-Participants</em></p></li>
  <li><p>add a global field (math expression) to the view and calculate the
  remaining places. The math expression could look like this (but
  depends on the name of your fields: [max_participants] - [id_1]</p></li>
  <li><p>add a views conditional field and define it similar to this: Views: <em>Views
  Conditional (If expression is Less than 1, output FULLY BOOKED, else
  output REGISTRATION AVAILABLE)</em> (also see screenshot)</p></li>
  </ol>
  
  <p>Be aware that this approach is also kind of a workaround and has some shortcomings. For example, the aggregation function would also count cancelled participants. You could set a filter but it may have undesired results on your view (such as not showing events without a registration).</p>
  
  <p>Nevertheless, the views conditional module in combination with the aggregate function may open up new possibilities for you. Just make sure to test properly before productive use.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-18T12:05:17.523Z
Answers.LastActivityDate: 2015-05-18T12:05:17.523Z
Answers.UserDisplayName: Fabian
Answers.Body: <p>In the Drupal extension <a href="https://www.drupal.org/project/civicrm_entity" rel="nofollow noreferrer">CiviCRM Entity</a> <a href="https://www.drupal.org/project/civicrm_entity/releases/7.x-2.0-beta9" rel="nofollow noreferrer">7.x-2.0-beta9 release</a> there is a new feature that allows to check if an event is full as view extra.</p>
  
  <blockquote>
    <p>CiviCRM Views Extras -- Added Views field handler for CiviCRM Events -
    Event is Full - True if event is full false otherwise</p>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-30T08:13:05.067Z
Answers.LastActivityDate: 2017-08-30T08:13:05.067Z
Answers.UserDisplayName: Francesc Bassas i Bullich
Answers.Body: <p>Just had to set this up, and the combo of civicrm entity 2.1 and views conditional works really well.</p>
  
  <p>Make a view of civicrm event type. Add the "event is full" field and then make the views conditional based on whether event is full is 0 or 1.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-26T07:18:22.477Z
Answers.LastActivityDate: 2018-04-26T07:18:22.477Z
Answers.UserDisplayName: joewickert
Answers.Body: <p>Yes you can. You can create your own views based upon the CiviCRM event data what you need to do is probably build a check in your view which compares the number of registered people of the number of available places.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-07T07:00:20.753Z
Answers.LastActivityDate: 2015-05-07T07:00:20.753Z
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Answers.Body: <p>We experience the same challenge. I see a solution with the views_php module but that is not a recommended module. Another way would be to use a custom event field that has the number of registered people (filled after every registration by a custom extension). That field would be available in the views module. But easier would be if there was a way provided by civicrm core to retrieve the number of registered people in a view. That field I believe is not available (yet).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-18T09:10:42.583Z
Answers.LastActivityDate: 2015-05-18T09:10:42.583Z
Answers.UserDisplayName: Richard van Oosterhout
Body: <p>Currently a user needs to click through to an Event info page before they know if it is full or not.</p>
  
  <p>Is there a way to take this information:</p>
  
  <blockquote>
    <p>"This event is currently full."</p>
  </blockquote>
  
  <p>and display it in a Drupal View/ Pane?</p>
  
Tags: <civievent>
Title: How can I display that an event is full on a Drupal View?
ThreadText: # How can I display that an event is full on a Drupal View?
  
  (Asked by: username_0 on 2015-05-06)
  
  Currently a user needs to click through to an Event info page before they know if it is full or not.
  
  Is there a way to take this information:
  
  > "This event is currently full."
  
  and display it in a Drupal View/ Pane?
  
  **Tags:** civievent
  
  
  ---
  
  ## 6 answers
  
  ### Answer by username_1 on 2015-05-07. Score: 5
  
  One approach would be to use the views_php module to embed a civicrm_api3 call to find out if the event is full, then print the result into the view. E.g.
  $event = civicrm_api3('Event', 'getsingle', array('return' => 'is_full', 'id' => $row->id));
  if (!empty($event['is_full']) {
    print "Event is full";
  }
  
  > **Comments:**
  > **username_2**: You can get the is_full value from the event get api call and requesting "return.is_full" in the params  
  > **username_3**: Two years later is still one of the best solutions?  
  
  ---
  
  ### Answer by username_4 on 2015-05-18. Score: 4
  
  We have been using the module "views conditional" to do that. Here's how it works:
  
  1. install and enable the module "Views Conditional"
  2. enable the relationship *Event -> Participant* in the view
  3. activate aggregation in the view in order to count the number of
     participants (hide it if necessary)
  4. add the field to the view: *(Event -> Participant) COUNT(CiviCRM
     Participants: Participant ID)* (hide it if necessary)
  5. add the field to the view: *CiviCRM Events: Event Max-Participants*
  6. add a global field (math expression) to the view and calculate the
     remaining places. The math expression could look like this (but
     depends on the name of your fields: [max\_participants] - [id\_1]
  7. add a views conditional field and define it similar to this: Views: *Views
     Conditional (If expression is Less than 1, output FULLY BOOKED, else
     output REGISTRATION AVAILABLE)* (also see screenshot)
  
  Be aware that this approach is also kind of a workaround and has some shortcomings. For example, the aggregation function would also count cancelled participants. You could set a filter but it may have undesired results on your view (such as not showing events without a registration).
  
  Nevertheless, the views conditional module in combination with the aggregate function may open up new possibilities for you. Just make sure to test properly before productive use.
  
  
  ---
  
  ### Answer by username_3 on 2017-08-30. Score: 3
  
  In the Drupal extension [CiviCRM Entity](https://www.drupal.org/project/civicrm_entity) [7.x-2.0-beta9 release](https://www.drupal.org/project/civicrm_entity/releases/7.x-2.0-beta9) there is a new feature that allows to check if an event is full as view extra.
  
  > CiviCRM Views Extras -- Added Views field handler for CiviCRM Events -
  > Event is Full - True if event is full false otherwise
  
  
  ---
  
  ### Answer by username_5 on 2018-04-26. Score: 2
  
  Just had to set this up, and the combo of civicrm entity 2.1 and views conditional works really well.
  
  Make a view of civicrm event type. Add the "event is full" field and then make the views conditional based on whether event is full is 0 or 1.
  
  
  ---
  
  ### Answer by username_6 on 2015-05-07. Score: 2
  
  Yes you can. You can create your own views based upon the CiviCRM event data what you need to do is probably build a check in your view which compares the number of registered people of the number of available places.
  
  
  ---
  
  ### Answer by username_7 on 2015-05-18. Score: 1
  
  We experience the same challenge. I see a solution with the views\_php module but that is not a recommended module. Another way would be to use a custom event field that has the number of registered people (filled after every registration by a custom extension). That field would be available in the views module. But easier would be if there was a way provided by civicrm core to retrieve the number of registered people in a view. That field I believe is not available (yet).
  
  
  ---
  
  