Answers.Body: <p>SearchKit can do what you want, but the two joins you've added are incorrect.</p>
  <ol>
  <li><p>Custom fields are not added using a join like the one in your screenshot. SearchKit treats custom fields as extensions of the primary table and automatically adds the left join for you without any explicit join needed. Simply add the desired custom fields to your search result, it's that simple. (FYI the join you've added in your screenshot is joining a contact with custom fields they have <em>created</em> - that's why the result shows only yourself: you're the administrator who created the set of custom fields in the backend).</p>
  </li>
  <li><p>When a contact participates in an event, the record generated is called a &quot;Participant&quot;. So your second join needs to be <strong>With (required) Contact Participants</strong>. (FYI the join you've added will join contacts to events they have <em>created</em>, e.g. the administrator who made the event in the system).</p>
  </li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-10T18:28:49.603Z
Answers.Text: i was going to suggest starting the search based on Participants rather than Contacts but perhaps their is an obvious reason not to do so?
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-10T19:31:57.547Z
Answers.Text: Huh. If I had just scrolled down a bit farther to see Contact Participant (which makes a whole lot more sense), this was painfully easy. Yeah, worked, thanks.
Answers.UserDisplayName: Michael Matthews
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-10T20:39:37.420Z
Answers.Text: @MichaelMatthews don't forget to accept this answer. Thanks!
Answers.UserDisplayName: Coleman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-10T18:12:18.033Z
Answers.LastActivityDate: 2024-11-10T18:12:18.033Z
Answers.UserDisplayName: Coleman
Body: <p>Trying to figure out SearchKit for what I thought would be a simple use case. CiviCRM 5.78.3.</p>
  <p>I'm trying to get report of every registered attendee of a specific Event, displaying some custom fields associated with each contact. This could be done by a simple Event participant search but not sure how to add fields to the results. I can easily get a list of all contacts with custom fields, but that doesn't tie the results to an event. This should be a nice easy filter setting, but so far it's eluding me.</p>
  <p>Granted, the SearchKit UI is not meant for easy, intuitive use, as looking at the query language (including SQL) that gets created tells me the science here is trying to figure out how to make the UI do what you want, but ... this is proving to be more challenging than expected.</p>
  <p>My current setup (which changes as I try various options to see what effect they have): Search for is this, to just define which tables I care about:
  <a href="https://i.sstatic.net/vmeerlo7.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/vmeerlo7.png" alt="Step One" /></a></p>
  <p>I've tried adding extra filters there, to no avail. So I add some filter conditions:</p>
  <p><a href="https://i.sstatic.net/eAnJrFdv.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/eAnJrFdv.png" alt="filter conditions" /></a></p>
  <p>What this gives me is just one result, of my logged-in admin account, that isn't even registered for the event in question.</p>
  <p>Which condition should be used to map a given contact to be registered for a given event? That info shows up in the CiviCRM user dashboard info, so I know it has to be in there somewhere (other than the basic, it has to work somehow). But none of the fields available to choose as a filter or condition seem to be about whether a contact is registered, just about event configuration or basic contact information.</p>
  <p>What silly thing am I doing wrong? Thanks...</p>
  
Tags: <searchkit>
Title: SearchKit for all Contacts registered for a specific Event with custom contact fields
ThreadText: # SearchKit for all Contacts registered for a specific Event with custom contact fields
  
  (Asked by: username_0 on 2024-11-10)
  
  Trying to figure out SearchKit for what I thought would be a simple use case. CiviCRM 5.78.3.
  
  I'm trying to get report of every registered attendee of a specific Event, displaying some custom fields associated with each contact. This could be done by a simple Event participant search but not sure how to add fields to the results. I can easily get a list of all contacts with custom fields, but that doesn't tie the results to an event. This should be a nice easy filter setting, but so far it's eluding me.
  
  Granted, the SearchKit UI is not meant for easy, intuitive use, as looking at the query language (including SQL) that gets created tells me the science here is trying to figure out how to make the UI do what you want, but ... this is proving to be more challenging than expected.
  
  My current setup (which changes as I try various options to see what effect they have): Search for is this, to just define which tables I care about:
  [![Step One](https://i.sstatic.net/vmeerlo7.png)](https://i.sstatic.net/vmeerlo7.png)
  
  I've tried adding extra filters there, to no avail. So I add some filter conditions:
  
  [![filter conditions](https://i.sstatic.net/eAnJrFdv.png)](https://i.sstatic.net/eAnJrFdv.png)
  
  What this gives me is just one result, of my logged-in admin account, that isn't even registered for the event in question.
  
  Which condition should be used to map a given contact to be registered for a given event? That info shows up in the CiviCRM user dashboard info, so I know it has to be in there somewhere (other than the basic, it has to work somehow). But none of the fields available to choose as a filter or condition seem to be about whether a contact is registered, just about event configuration or basic contact information.
  
  What silly thing am I doing wrong? Thanks...
  
  **Tags:** searchkit
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-11-10. Score: 4 | Accepted answer
  
  SearchKit can do what you want, but the two joins you've added are incorrect.
  
  1. Custom fields are not added using a join like the one in your screenshot. SearchKit treats custom fields as extensions of the primary table and automatically adds the left join for you without any explicit join needed. Simply add the desired custom fields to your search result, it's that simple. (FYI the join you've added in your screenshot is joining a contact with custom fields they have *created* - that's why the result shows only yourself: you're the administrator who created the set of custom fields in the backend).
  2. When a contact participates in an event, the record generated is called a "Participant". So your second join needs to be **With (required) Contact Participants**. (FYI the join you've added will join contacts to events they have *created*, e.g. the administrator who made the event in the system).
  
  > **Comments:**
  > **username_2**: i was going to suggest starting the search based on Participants rather than Contacts but perhaps their is an obvious reason not to do so?  
  > **username_0**: Huh. If I had just scrolled down a bit farther to see Contact Participant (which makes a whole lot more sense), this was painfully easy. Yeah, worked, thanks.  
  > **username_1**: @MichaelMatthews don't forget to accept this answer. Thanks!  
  
  ---
  
  