Answers.Body: <p>I figured out one way using profiles.</p>
  
  <p><strong>CREATE A PROFILE</strong></p>
  
  <ol>
  <li><p>The first 4 steps that you'll only need to do once starts with going to Administer, Customize Data &amp; Screens, Profiles. Click Add Profile.</p></li>
  <li><p>Give it a name such as "Update Child Participant Details", add a description if you like, check "Used for" + "Standalone Form or Directory", check "Is this Profile Active". Under Advanced Settings change "Limit Listings to a specific group" to "Attendees". Leave the rest as is. Click Save.</p></li>
  <li><p>It will now ask for a Profile Field, select Participants, Registered by ID. Check "Required" (since presumably this is the whole reason you want to create this in the first place). Leave the remaining fields as they are. If you want to update another field for the child (ie dietary restrictions, etc) then click "Save and New", else click "Save" to finish. NOTE: You cannot mix fields from other records, they all have to be from "Participants". If you try to use one from "Contacts" for instance, it will give you an error in later steps.</p></li>
  <li><p>Click Preview (all fields) and your Registered by ID field and any others you created should appear. Click Done with Preview. You will only have to do this once, this completes the Profile steps.</p></li>
  </ol>
  
  <p><strong>CREATE A PARTICIPANT ID REPORT</strong></p>
  
  <ol>
  <li><p>You will only need to create this report once. Go to Events, Reports, Attendee List.</p></li>
  <li><p>Checkmark Columns, add Participant ID, Registered by Participant ID, Event, Status, Role, Fee Level and Participant Fee, then click View Results. Your report should now show the parents along with their children (everyone who registered). The Fee level field should presumably identify the parents from the children assuming the fee structure is different (ie under 12 free).</p></li>
  <li><p>Click on Title and Format, change the name to something more appropriate such as "Attendee List with IDs", then on the same screen under Actions, select "Save a copy" (not Save or it will overwrite the original), parent menu can be Events, Event Reports. This is where you'll find this report later.</p></li>
  <li><p>Now that you've created your report showing the children with Registered_by_ID = null (blank), you will now know which child's record to edit. Keep this browser tab open to refer to, and open a second browser tab or window.</p></li>
  </ol>
  
  <p><strong>USING THE PROFILE AND REPORT TO EDIT THE CHILD RECORD</strong></p>
  
  <ol>
  <li><p>In the new browser tab or window, open CiviCRM and go to Events, Dashboard.</p></li>
  <li><p>If you only have 1 event showing, you should see all your attendees below. If you have more than 1 event, click on "Registered" to the right of your event. You should now see all your attendees below.</p></li>
  <li><p>With the Civi Report you left open in the previous browser tab or window, you can find the name(s) of the parent and their children. You'll be focusing on the children that do not have an ID number in the field Registered_by_ID because we will want to change this from null to their parent's ID. Make a note of the child(ren) and parent.</p></li>
  <li><p>Switch back to your 2nd browser tab or window. Click the box next to the name(s) of the child(ren) that you want to associate with the parent that registered them.</p></li>
  <li><p>Click on "Actions", and choose "Update Multiple Participants" which should be at the bottom of that list. Give Civi a moment, then you should see a page called "Update Multiple Participants" with a Select Profile dropdown. Choose the Profile you created in the first steps and click Continue.</p></li>
  <li><p>The child(ren) should appear now, though unfortunately this screen does not list their participant IDs nor their parents. This is why you'll want to switch back to the other browser tab or window, obtain their parent's participant ID, and enter it into the "Registered by ID" box beside their child(ren)'s names on the 2nd browser tab or window. If you created any other fields in the profile (ie Dietary restrictions) then they will also appear here too. Click the "Update Participant(s)" button to finish.</p></li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-03T19:49:20.370Z
Answers.LastActivityDate: 2018-05-03T19:49:20.370Z
Answers.UserDisplayName: JP6805
Answers.Body: <p>Usually using the api instead of update/get you want to issue a create with the relevant ID field filled in. The api call will then update the relevant record. For participant you would want to supply the participant id.</p>
  
  <p>However I'd not recommend you use the API in this manner :)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-07T18:54:24.470Z
Answers.Text: Is this in the API explorer? out of curiosity
Answers.UserDisplayName: JP6805
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-07T20:49:45.293Z
Answers.Text: Yes - Sorry I should have been clearer. The API explorer gives you interactive access to the API. But the result of using an api call via the api, or via some other method, drush cv php etc will be the same.
Answers.UserDisplayName: Luke Stewart
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-07T05:12:53.980Z
Answers.LastActivityDate: 2018-05-07T05:12:53.980Z
Answers.UserDisplayName: Luke Stewart
Body: <p>CiviCRM 4.7.29, Wordpress 4.9.5</p>
  
  <p>I am unable to do a replace in the API explorer. I can do a "get" however. The situation is that a parent registered for an event, but forgot to change the number of registrants under his registration from 1 (him) to 3 (him + 2 kids). They were under 12 yrs so I just manually entered them. However, the kids now show as Registered_by_ID = null, and I want them to be the ID of the parent.</p>
  
  <p>(NOTE: Am not a developer, just a volunteer with middle level of experience.)</p>
  
  <p>When I do a "get", I can find his 2 kids by participant ID. Next, in API Explorer I use Entity = Participant, Action = Replace, and I would expect that the interface would allow me to choose the Participant I want to perform the action on, followed by a field on which I want to change from one value to another. Instead, it allows me to choose 1 field and 1 value and says it is going to update the database, so I chose no. How do I know what participants this is going to change since it doesn't let me choose who? How does it know what value from -> to I want to change?</p>
  
  <p>I checked the examples <a href="https://github.com/civicrm/civicrm-core/tree/master/api/v3/examples" rel="nofollow noreferrer">here</a> but Registered_by_ID is not listed. Does that mean a replace won't work on that ?</p>
  
  <p>In the end, I'm open to suggestions of either how to get the API explorer to do what I want (change the Registered_by_ID from null to the parent's ID), or else if there's some other obscure way (ie Profiles?).</p>
  
  <p>Thank you.</p>
  
Tags: <api><fields>
Title: Unable to do "replace" in API Explorer
ThreadText: # Unable to do "replace" in API Explorer
  
  (Asked by: username_0 on 2018-05-03)
  
  CiviCRM 4.7.29, Wordpress 4.9.5
  
  I am unable to do a replace in the API explorer. I can do a "get" however. The situation is that a parent registered for an event, but forgot to change the number of registrants under his registration from 1 (him) to 3 (him + 2 kids). They were under 12 yrs so I just manually entered them. However, the kids now show as Registered\_by\_ID = null, and I want them to be the ID of the parent.
  
  (NOTE: Am not a developer, just a volunteer with middle level of experience.)
  
  When I do a "get", I can find his 2 kids by participant ID. Next, in API Explorer I use Entity = Participant, Action = Replace, and I would expect that the interface would allow me to choose the Participant I want to perform the action on, followed by a field on which I want to change from one value to another. Instead, it allows me to choose 1 field and 1 value and says it is going to update the database, so I chose no. How do I know what participants this is going to change since it doesn't let me choose who? How does it know what value from -> to I want to change?
  
  I checked the examples [here](https://github.com/civicrm/civicrm-core/tree/master/api/v3/examples) but Registered\_by\_ID is not listed. Does that mean a replace won't work on that ?
  
  In the end, I'm open to suggestions of either how to get the API explorer to do what I want (change the Registered\_by\_ID from null to the parent's ID), or else if there's some other obscure way (ie Profiles?).
  
  Thank you.
  
  **Tags:** api, fields
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2018-05-03. Score: 1
  
  I figured out one way using profiles.
  
  **CREATE A PROFILE**
  
  1. The first 4 steps that you'll only need to do once starts with going to Administer, Customize Data & Screens, Profiles. Click Add Profile.
  2. Give it a name such as "Update Child Participant Details", add a description if you like, check "Used for" + "Standalone Form or Directory", check "Is this Profile Active". Under Advanced Settings change "Limit Listings to a specific group" to "Attendees". Leave the rest as is. Click Save.
  3. It will now ask for a Profile Field, select Participants, Registered by ID. Check "Required" (since presumably this is the whole reason you want to create this in the first place). Leave the remaining fields as they are. If you want to update another field for the child (ie dietary restrictions, etc) then click "Save and New", else click "Save" to finish. NOTE: You cannot mix fields from other records, they all have to be from "Participants". If you try to use one from "Contacts" for instance, it will give you an error in later steps.
  4. Click Preview (all fields) and your Registered by ID field and any others you created should appear. Click Done with Preview. You will only have to do this once, this completes the Profile steps.
  
  **CREATE A PARTICIPANT ID REPORT**
  
  1. You will only need to create this report once. Go to Events, Reports, Attendee List.
  2. Checkmark Columns, add Participant ID, Registered by Participant ID, Event, Status, Role, Fee Level and Participant Fee, then click View Results. Your report should now show the parents along with their children (everyone who registered). The Fee level field should presumably identify the parents from the children assuming the fee structure is different (ie under 12 free).
  3. Click on Title and Format, change the name to something more appropriate such as "Attendee List with IDs", then on the same screen under Actions, select "Save a copy" (not Save or it will overwrite the original), parent menu can be Events, Event Reports. This is where you'll find this report later.
  4. Now that you've created your report showing the children with Registered\_by\_ID = null (blank), you will now know which child's record to edit. Keep this browser tab open to refer to, and open a second browser tab or window.
  
  **USING THE PROFILE AND REPORT TO EDIT THE CHILD RECORD**
  
  1. In the new browser tab or window, open CiviCRM and go to Events, Dashboard.
  2. If you only have 1 event showing, you should see all your attendees below. If you have more than 1 event, click on "Registered" to the right of your event. You should now see all your attendees below.
  3. With the Civi Report you left open in the previous browser tab or window, you can find the name(s) of the parent and their children. You'll be focusing on the children that do not have an ID number in the field Registered\_by\_ID because we will want to change this from null to their parent's ID. Make a note of the child(ren) and parent.
  4. Switch back to your 2nd browser tab or window. Click the box next to the name(s) of the child(ren) that you want to associate with the parent that registered them.
  5. Click on "Actions", and choose "Update Multiple Participants" which should be at the bottom of that list. Give Civi a moment, then you should see a page called "Update Multiple Participants" with a Select Profile dropdown. Choose the Profile you created in the first steps and click Continue.
  6. The child(ren) should appear now, though unfortunately this screen does not list their participant IDs nor their parents. This is why you'll want to switch back to the other browser tab or window, obtain their parent's participant ID, and enter it into the "Registered by ID" box beside their child(ren)'s names on the 2nd browser tab or window. If you created any other fields in the profile (ie Dietary restrictions) then they will also appear here too. Click the "Update Participant(s)" button to finish.
  
  
  ---
  
  ### Answer by username_1 on 2018-05-07. Score: 1
  
  Usually using the api instead of update/get you want to issue a create with the relevant ID field filled in. The api call will then update the relevant record. For participant you would want to supply the participant id.
  
  However I'd not recommend you use the API in this manner :)
  
  > **Comments:**
  > **username_0**: Is this in the API explorer? out of curiosity  
  > **username_1**: Yes - Sorry I should have been clearer. The API explorer gives you interactive access to the API. But the result of using an api call via the api, or via some other method, drush cv php etc will be the same.  
  
  ---
  
  