Answers.Body: <p>Looking at the table "civicrm_participant", I can see a field "registered_by_id", which is presumably the one you want.</p>
  
  <p>I'd note that you're using the field in a way that isn't strictly what it was designed for - i.e. you're taking the person who registers someone else and using that as having a particular relationship to them.</p>
  
  <p>So I can think of three solutions:</p>
  
  <ol>
  <li><p>Reconsider your requirements/architecture - perhaps add a relationship or some other way of connecting the guest to the primary registrant.</p></li>
  <li><p>Use an indirect way of filling the registered_by_id field, e.g. have  custom registrant/participant field that is only exposed to administrators, and use rules or something like that to fill in registered_by_id when this custom field is filled.</p></li>
  <li><p>Write an extension that exposes the field to the administrative form.</p></li>
  </ol>
  
  <p>Short answer: no (no simpler solution).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-11T23:34:23.647Z
Answers.Text: "perhaps add a relationship or some other way of connecting the guest to the primary registrant" - eg a Contact Reference field?
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-12T13:18:22.340Z
Answers.Text: Hmmm. Interesting suggestions, especially Alan's option 2 and the conference reference field which I hadn't thought about.  A third option i'm considering is customizing the civireport to include the "participant source" column (which admittedly, I know I'm not using in the way it was intended!) if the registered_by_id field is empty.  But thanks to you both for the creative suggestions!
Answers.UserDisplayName: minbori
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-11T17:18:05.467Z
Answers.LastActivityDate: 2019-12-11T17:18:05.467Z
Answers.UserDisplayName: Alan Dixon
Answers.Body: <p>Anyone solved this yet?  It's always been a frustration that front end event bookings creates a link between the &quot;Registered by&quot; Contact and their Guests that can be reported on, but if an admin is then registering additional Guests for a Member, they cannot specify this same &quot;Registered by&quot; link to the lead Contact for the party.</p>
  <p>This is particularly problematic for dinners, etc., where Civi admins need to put parties together on tables based on the lead event registrant.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-01T20:31:42.773Z
Answers.Text: this doesn't seem like an answer yet. perhaps edit to mention you have the code to fix?
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-01T15:01:27.123Z
Answers.LastActivityDate: 2020-09-01T15:01:27.123Z
Answers.UserDisplayName: Marcus J Wilson
Body: <p>because of my workaround for <a href="https://civicrm.stackexchange.com/questions/33853/how-can-a-participant-return-to-sign-up-more-additional-participants">this</a> issue I occasionally need to add event participants with the role of "guest" via the admin backend.  That's ok, but when I register a guest this way I'm not able to specify the "registered by" data that gets added automatically when an Attendee registers himself and multiple others using the frontend registration form.  I'd like to have this info because I need to know which participant the guest belongs to.</p>
  
  <p>I've been putting the name of the main Attendee into the "Participant Source" field just to capture the data, but this of course doesn't show up in the "Registered by" columns in reports.</p>
  
  <p>Is there a hook I could use to copy that Participant Source field into the "registered by" field?  Or am I missing a simpler solution?</p>
  
  <p>Thanks! This is a Joomla 3.9.13 system with CiviCRM 5.18.2.</p>
  
Tags: <civievent><registration>
Title: how to add "registered by" information to a guest that is being registered manually in the backend?
ThreadText: # how to add "registered by" information to a guest that is being registered manually in the backend?
  
  (Asked by: username_0 on 2019-12-11)
  
  because of my workaround for [this](https://civicrm.stackexchange.com/questions/33853/how-can-a-participant-return-to-sign-up-more-additional-participants) issue I occasionally need to add event participants with the role of "guest" via the admin backend. That's ok, but when I register a guest this way I'm not able to specify the "registered by" data that gets added automatically when an Attendee registers himself and multiple others using the frontend registration form. I'd like to have this info because I need to know which participant the guest belongs to.
  
  I've been putting the name of the main Attendee into the "Participant Source" field just to capture the data, but this of course doesn't show up in the "Registered by" columns in reports.
  
  Is there a hook I could use to copy that Participant Source field into the "registered by" field? Or am I missing a simpler solution?
  
  Thanks! This is a Joomla 3.9.13 system with CiviCRM 5.18.2.
  
  **Tags:** civievent, registration
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-12-11. Score: 1
  
  Looking at the table "civicrm\_participant", I can see a field "registered\_by\_id", which is presumably the one you want.
  
  I'd note that you're using the field in a way that isn't strictly what it was designed for - i.e. you're taking the person who registers someone else and using that as having a particular relationship to them.
  
  So I can think of three solutions:
  
  1. Reconsider your requirements/architecture - perhaps add a relationship or some other way of connecting the guest to the primary registrant.
  2. Use an indirect way of filling the registered\_by\_id field, e.g. have custom registrant/participant field that is only exposed to administrators, and use rules or something like that to fill in registered\_by\_id when this custom field is filled.
  3. Write an extension that exposes the field to the administrative form.
  
  Short answer: no (no simpler solution).
  
  > **Comments:**
  > **username_2**: "perhaps add a relationship or some other way of connecting the guest to the primary registrant" - eg a Contact Reference field?  
  > **username_0**: Hmmm. Interesting suggestions, especially Alan's option 2 and the conference reference field which I hadn't thought about.  A third option i'm considering is customizing the civireport to include the "participant source" column (which admittedly, I know I'm not using in the way it was intended!) if the registered_by_id field is empty.  But thanks to you both for the creative suggestions!  
  
  ---
  
  ### Answer by username_3 on 2020-09-01. Score: 0
  
  Anyone solved this yet? It's always been a frustration that front end event bookings creates a link between the "Registered by" Contact and their Guests that can be reported on, but if an admin is then registering additional Guests for a Member, they cannot specify this same "Registered by" link to the lead Contact for the party.
  
  This is particularly problematic for dinners, etc., where Civi admins need to put parties together on tables based on the lead event registrant.
  
  > **Comments:**
  > **username_2**: this doesn't seem like an answer yet. perhaps edit to mention you have the code to fix?  
  
  ---
  
  