Answers.Body: <p>This feature has been <a href="https://github.com/civicrm/civicrm-core/pull/27839" rel="nofollow noreferrer">recently added to SearchKit</a> and will be part of the upcoming 5.68 release.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-22T09:04:34.527Z
Answers.Text: Thank you - good to hear! <3 As far as I can tell, 5.68 is released early Dec'23, correct?
Answers.UserDisplayName: Torben Gundtofte-Bruun
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-22T11:11:31.993Z
Answers.Text: Yes that's right
Answers.UserDisplayName: Coleman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-16T08:57:33.783Z
Answers.Text: Just to confirm: I am now using this new field "event.remaining_participants" and it's fine!
Answers.UserDisplayName: Torben Gundtofte-Bruun
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-21T22:25:14.990Z
Answers.LastActivityDate: 2023-10-21T22:25:14.990Z
Answers.UserDisplayName: Coleman
Body: <p>How to create a SearchKit result of CiviEvent events, where the result contains the number of free slots left in the event?</p>
  <p><strong>What I have:</strong></p>
  <ul>
  <li>My test setup is newest WP 6.3.2 and newest CiviCRM 5.66.0.</li>
  <li>CiviEvent: several events, with a max no. of participants, and some registrations on those events.</li>
  <li>SearchKit: a search that gives me open events in the next 2 weeks.<br />
  The result presents no actions, no sorting, just a static table listing.</li>
  <li>Form Builder: a form to hold the results from the search.</li>
  <li>WordPress: a page that contains the shortcode with my search.</li>
  </ul>
  <p><strong>What I want:</strong></p>
  <ul>
  <li>The form content should contain a column with the number of remaining available slots, to answer a question like &quot;can I register 4 more people to this, or are there not enough free spaces left?</li>
  <li>How do I build a search query that can take the max no. of participants and then subtract the number of already-registered from that?</li>
  </ul>
  
Tags: <civievent><searchkit>
Title: CiviEvent + SearchKit = number of free slots in an event?
ThreadText: # CiviEvent + SearchKit = number of free slots in an event?
  
  (Asked by: username_0 on 2023-10-21)
  
  How to create a SearchKit result of CiviEvent events, where the result contains the number of free slots left in the event?
  
  **What I have:**
  
  * My test setup is newest WP 6.3.2 and newest CiviCRM 5.66.0.
  * CiviEvent: several events, with a max no. of participants, and some registrations on those events.
  * SearchKit: a search that gives me open events in the next 2 weeks.  
    The result presents no actions, no sorting, just a static table listing.
  * Form Builder: a form to hold the results from the search.
  * WordPress: a page that contains the shortcode with my search.
  
  **What I want:**
  
  * The form content should contain a column with the number of remaining available slots, to answer a question like "can I register 4 more people to this, or are there not enough free spaces left?
  * How do I build a search query that can take the max no. of participants and then subtract the number of already-registered from that?
  
  **Tags:** civievent, searchkit
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-10-21. Score: 3 | Accepted answer
  
  This feature has been [recently added to SearchKit](https://github.com/civicrm/civicrm-core/pull/27839) and will be part of the upcoming 5.68 release.
  
  > **Comments:**
  > **username_0**: Thank you - good to hear! <3 As far as I can tell, 5.68 is released early Dec'23, correct?  
  > **username_1**: Yes that's right  
  > **username_0**: Just to confirm: I am now using this new field "event.remaining_participants" and it's fine!  
  
  ---
  
  