Answers.Body: <p>The answer of @Coleman above was perfect, I could even do more than expected.
  Detailed solution below.</p>
  <p>Tabs in the form :</p>
  <ul>
  <li>parents</li>
  <li>related children</li>
  <li>relationship</li>
  </ul>
  <p>Related children are autofilled as &quot;Child of current user&quot;, and made a repeating entity</p>
  <p><a href="https://i.sstatic.net/o7dkC.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/o7dkC.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.sstatic.net/1IWo2.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/1IWo2.png" alt="enter image description here" /></a></p>
  <p>Parents are autofilled as &quot;Parent of related children&quot;, and also repeating entity.
  With this trick, we get the data of the other parent :)</p>
  <p><a href="https://i.sstatic.net/Vq1dm.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Vq1dm.png" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-18T14:20:14.520Z
Answers.LastActivityDate: 2023-08-18T14:20:14.520Z
Answers.UserDisplayName: stackexchange user
Answers.Body: <p>Well articulated question!
  I noticed in your screenshot that you have 2 child entities on the form. They are both being filled in the same way, so they both get the same result. Not what you want, but I understand why the computer would do that .</p>
  <p>I think you might get your desired result if you only have 1 child entity on the form, and make it a repeating entity. If you still want a maximum of 2 you can configure a limit to the repeat setting.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-18T14:26:14.593Z
Answers.Text: thx a lot @Coleman for your answer, it worked! I have detailed the solution with screenshots.
  Since then I have been struggling with 2 problems (bugs) using search kit + autofill + autocomplete (using them as a workaround to this [Deduper](https://civicrm.stackexchange.com/questions/45405/deduper-fails-with-punctations-in-the-name-dot-semicolon-underscore-parenthe) issue)
  Would highly appreciate your feedback about these 2 :
Answers.UserDisplayName: stackexchange user
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-18T14:29:21.453Z
Answers.Text: PROBLEM 1 : [error (infinite loop ?) when using formbuilder + autofill + autocomplete existing user](https://civicrm.stackexchange.com/questions/45414/error-infinite-loop-when-using-formbuilder-autofill-autocomplete-existin)
Answers.UserDisplayName: stackexchange user
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-18T14:31:12.090Z
Answers.Text: PROBLEM 2:
  [error when using formbuilder + autocomplete existing user + sub-type](https://civicrm.stackexchange.com/questions/45413/error-when-using-formbuilder-autocomplete-existing-user-sub-type)
Answers.UserDisplayName: stackexchange user
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-07-17T14:25:06.590Z
Answers.LastActivityDate: 2023-07-17T14:25:06.590Z
Answers.UserDisplayName: Coleman
Body: <h2><strong>Summary</strong></h2>
  <p>This is a follow up question of <a href="https://civicrm.stackexchange.com/questions/42678/create-relationships-using-profiles-or-forms">that one</a>, that I asked a year ago when FormBuilder was not as advanced as today. There was no easy solution, now there is almost one, so a big thx and congrats to the FormBuilder developpers :)</p>
  <p>Our use case is probably very common : a form where a parent can fill in his own data and the data of his two children, with &quot;parent of / child of&quot; relationships.</p>
  <p>We would like the names and data of the parent and related children to be auto-filled, if already present in Civicrm, and this is where we are <strong>failing for the second child</strong>.</p>
  <ul>
  <li>Parent autofill : ok</li>
  <li>Child 1 autofill : ok</li>
  <li>Child 2 autofill : NOT ok, it is autofilled with the data of Child 1 :(</li>
  </ul>
  <hr />
  <h2>Details</h2>
  <p>This form seems to work as expected to create new parent and children from a blank form</p>
  <p><a href="https://i.sstatic.net/Q8q4U.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Q8q4U.png" alt="enter image description here" /></a></p>
  <p>Then we use the email token in Civimail, so that existing Parents can update their data and children.The email token is <code>{afform.afformTestLink}</code></p>
  <p><a href="https://i.sstatic.net/vEuKT.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/vEuKT.png" alt="enter image description here" /></a></p>
  <p>Autofill is working ok for the parent, and one child</p>
  <p><strong>For Parent1 :</strong></p>
  <p><a href="https://i.sstatic.net/Z8qZ9.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Z8qZ9.png" alt="enter image description here" /></a></p>
  <p><strong>For Child 1</strong>: &quot;child of / current user&quot;
  <a href="https://i.sstatic.net/sjV14.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/sjV14.png" alt="enter image description here" /></a></p>
  <p><strong>For Child 2</strong>: same as child 1, although the parent as 2 different children already related to him in civicrm</p>
  <p><a href="https://i.sstatic.net/sjV14.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/sjV14.png" alt="enter image description here" /></a></p>
  <h2>PROBLEM</h2>
  <p>child 2 is autofilled with the same data as child 1 :(</p>
  
Tags: <relationships><formbuilder>
Title: Formbuilder relationships - Autofill several relationships
ThreadText: # Formbuilder relationships - Autofill several relationships
  
  (Asked by: username_0 on 2023-07-11)
  
  ## **Summary**
  
  This is a follow up question of [that one](https://civicrm.stackexchange.com/questions/42678/create-relationships-using-profiles-or-forms), that I asked a year ago when FormBuilder was not as advanced as today. There was no easy solution, now there is almost one, so a big thx and congrats to the FormBuilder developpers :)
  
  Our use case is probably very common : a form where a parent can fill in his own data and the data of his two children, with "parent of / child of" relationships.
  
  We would like the names and data of the parent and related children to be auto-filled, if already present in Civicrm, and this is where we are **failing for the second child**.
  
  * Parent autofill : ok
  * Child 1 autofill : ok
  * Child 2 autofill : NOT ok, it is autofilled with the data of Child 1 :(
  
  ---
  
  ## Details
  
  This form seems to work as expected to create new parent and children from a blank form
  
  [![enter image description here](https://i.sstatic.net/Q8q4U.png)](https://i.sstatic.net/Q8q4U.png)
  
  Then we use the email token in Civimail, so that existing Parents can update their data and children.The email token is `{afform.afformTestLink}`
  
  [![enter image description here](https://i.sstatic.net/vEuKT.png)](https://i.sstatic.net/vEuKT.png)
  
  Autofill is working ok for the parent, and one child
  
  **For Parent1 :**
  
  [![enter image description here](https://i.sstatic.net/Z8qZ9.png)](https://i.sstatic.net/Z8qZ9.png)
  
  **For Child 1**: "child of / current user"
  [![enter image description here](https://i.sstatic.net/sjV14.png)](https://i.sstatic.net/sjV14.png)
  
  **For Child 2**: same as child 1, although the parent as 2 different children already related to him in civicrm
  
  [![enter image description here](https://i.sstatic.net/sjV14.png)](https://i.sstatic.net/sjV14.png)
  
  ## PROBLEM
  
  child 2 is autofilled with the same data as child 1 :(
  
  **Tags:** relationships, formbuilder
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2023-08-18. Score: 2 | Accepted answer
  
  The answer of @username_1 above was perfect, I could even do more than expected.
  Detailed solution below.
  
  Tabs in the form :
  
  * parents
  * related children
  * relationship
  
  Related children are autofilled as "Child of current user", and made a repeating entity
  
  [![enter image description here](https://i.sstatic.net/o7dkC.png)](https://i.sstatic.net/o7dkC.png)
  
  [![enter image description here](https://i.sstatic.net/1IWo2.png)](https://i.sstatic.net/1IWo2.png)
  
  Parents are autofilled as "Parent of related children", and also repeating entity.
  With this trick, we get the data of the other parent :)
  
  [![enter image description here](https://i.sstatic.net/Vq1dm.png)](https://i.sstatic.net/Vq1dm.png)
  
  
  ---
  
  ### Answer by username_1 on 2023-07-17. Score: 2
  
  Well articulated question!
  I noticed in your screenshot that you have 2 child entities on the form. They are both being filled in the same way, so they both get the same result. Not what you want, but I understand why the computer would do that .
  
  I think you might get your desired result if you only have 1 child entity on the form, and make it a repeating entity. If you still want a maximum of 2 you can configure a limit to the repeat setting.
  
  > **Comments:**
  > **username_0**: thx a lot @username_1 for your answer, it worked! I have detailed the solution with screenshots. Since then I have been struggling with 2 problems (bugs) using search kit + autofill + autocomplete (using them as a workaround to this [Deduper](https://civicrm.stackexchange.com/questions/45405/deduper-fails-with-punctations-in-the-name-dot-semicolon-underscore-parenthe) issue) Would highly appreciate your feedback about these 2 :  
  > **username_0**: PROBLEM 1 : [error (infinite loop ?) when using formbuilder + autofill + autocomplete existing user](https://civicrm.stackexchange.com/questions/45414/error-infinite-loop-when-using-formbuilder-autofill-autocomplete-existin)  
  > **username_0**: PROBLEM 2: [error when using formbuilder + autocomplete existing user + sub-type](https://civicrm.stackexchange.com/questions/45413/error-when-using-formbuilder-autocomplete-existing-user-sub-type)  
  
  ---
  
  