Answers.Body: <p>That was indeed a bug in FormBuilder. Multiple bugs in fact. I've fixed them all in this PR: <a href="https://github.com/civicrm/civicrm-core/pull/27121" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/27121</a></p>
  <p>You can help by reviewing the PR, you'll find instructions for doing so right under the description (in the comment posted by CiviBot).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-07-02T07:44:54.447Z
Answers.Text: marking this as answered (that was several months ago). Thanks @Coleman !
Answers.UserDisplayName: stackexchange user
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-22T18:34:54.187Z
Answers.LastActivityDate: 2023-08-22T21:01:28.673Z
Answers.LastEditDate: 2023-08-22T21:01:28.673Z
Answers.UserDisplayName: Coleman
Body: <h2>Summary</h2>
  <p>Our use case is probably very common : a form where a parent can fill in his own data and the data of his children, with &quot;parent of / child of&quot; relationships.</p>
  <p>In order to avoid creation of duplicate children (and because we have found out that Deduper does not work if there is an hyphen in the name), we use a workaround with Searchkit + Autocomplete + Formbuilder, so that parents can pick up their children already existing in our civicrm.</p>
  <p>Problem: if we use autofill to display the children already with a &quot;child of&quot; relationship, then the content of some fields blink and changes endlessly</p>
  <p>Bug ? Missing feature ? Something wrong in our setup ?</p>
  <h2>Details</h2>
  <p><strong>Searchkit</strong> : a basic contact search, where sub-type = child</p>
  <p><a href="https://i.sstatic.net/QKxxH.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/QKxxH.png" alt="enter image description here" /></a></p>
  <p><strong>Autocomplete in Searchkit</strong> : a basic configuration showing the full name of the child. Works well in preview in Searchkit / Autocomplete page</p>
  <p><strong>Formbuilder</strong>
  A basic form with individual (multiple),  a search box &quot;existing user&quot;, leveraging the autocomplete described above. In open access.
  Autofill : child of current user</p>
  <p><a href="https://i.sstatic.net/wcjon.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/wcjon.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.sstatic.net/JoCT4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/JoCT4.png" alt="enter image description here" /></a></p>
  <p>What happens : on screenshot below, the content of the red field alternate very rapidely (creating a &quot;blinking&quot; effect) between :</p>
  <ul>
  <li>empty</li>
  <li>9845 (which is the contact ID of Bart Simpson)</li>
  <li>Bart Simpson</li>
  </ul>
  <p><a href="https://i.sstatic.net/Cj2Or.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Cj2Or.png" alt="enter image description here" /></a></p>
  <p>Then if we click on &quot;add&quot; to creation an additional child, it gets worse : the 3 yellow fields have the same blinking / alternating problem, their content cycle between Bart Simpson and Lisa Simpson (the 2 children)</p>
  <p><a href="https://i.sstatic.net/WRGcV.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/WRGcV.png" alt="enter image description here" /></a></p>
  <p>Then if in the green box we select &quot;Hugo Simpson&quot;, then the yellow fields have the blinking / alternating problem, they cycle between Hugo and Lisa (note that Bart seems to have disappeared ;). And the name fields below the green field remain empty</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-18T18:11:44.767Z
Comments.Text: Which version of CiviCRM are you using?
Comments.UserDisplayName: Coleman
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-18T20:01:39.770Z
Comments.Text: 5.62.1 (I should have said that in the original question, sorry ;)
Comments.UserDisplayName: stackexchange user
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-20T18:21:52.080Z
Comments.Text: Could you please try again on the latest (5.64+)? IIRC there have been some fixes in this area recently.
Comments.UserDisplayName: Coleman
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-21T14:23:57.683Z
Comments.Text: I have just reproduced the problem on https://dmaster.demo.civicrm.org/civicrm/test
  v 5.66.alpha1
  
  I guess dmaster will be reset in about an hour, but if you connect to this URL  before with the demo admin account, you will see the problem
Comments.UserDisplayName: stackexchange user
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-22T01:28:34.170Z
Comments.Text: You're right the demo site didn't last long enough but I'll try to reproduce based on your screenshots...
Comments.UserDisplayName: Coleman
Tags: <searchkit><formbuilder><autocomplete>
Title: error (infinite loop ?) when using formbuilder + autofill + autocomplete existing user
ThreadText: # error (infinite loop ?) when using formbuilder + autofill + autocomplete existing user
  
  (Asked by: username_0 on 2023-08-18)
  
  ## Summary
  
  Our use case is probably very common : a form where a parent can fill in his own data and the data of his children, with "parent of / child of" relationships.
  
  In order to avoid creation of duplicate children (and because we have found out that Deduper does not work if there is an hyphen in the name), we use a workaround with Searchkit + Autocomplete + Formbuilder, so that parents can pick up their children already existing in our civicrm.
  
  Problem: if we use autofill to display the children already with a "child of" relationship, then the content of some fields blink and changes endlessly
  
  Bug ? Missing feature ? Something wrong in our setup ?
  
  ## Details
  
  **Searchkit** : a basic contact search, where sub-type = child
  
  [![enter image description here](https://i.sstatic.net/QKxxH.png)](https://i.sstatic.net/QKxxH.png)
  
  **Autocomplete in Searchkit** : a basic configuration showing the full name of the child. Works well in preview in Searchkit / Autocomplete page
  
  **Formbuilder**
  A basic form with individual (multiple), a search box "existing user", leveraging the autocomplete described above. In open access.
  Autofill : child of current user
  
  [![enter image description here](https://i.sstatic.net/wcjon.png)](https://i.sstatic.net/wcjon.png)
  
  [![enter image description here](https://i.sstatic.net/JoCT4.png)](https://i.sstatic.net/JoCT4.png)
  
  What happens : on screenshot below, the content of the red field alternate very rapidely (creating a "blinking" effect) between :
  
  * empty
  * 9845 (which is the contact ID of Bart Simpson)
  * Bart Simpson
  
  [![enter image description here](https://i.sstatic.net/Cj2Or.png)](https://i.sstatic.net/Cj2Or.png)
  
  Then if we click on "add" to creation an additional child, it gets worse : the 3 yellow fields have the same blinking / alternating problem, their content cycle between Bart Simpson and Lisa Simpson (the 2 children)
  
  [![enter image description here](https://i.sstatic.net/WRGcV.png)](https://i.sstatic.net/WRGcV.png)
  
  Then if in the green box we select "Hugo Simpson", then the yellow fields have the blinking / alternating problem, they cycle between Hugo and Lisa (note that Bart seems to have disappeared ;). And the name fields below the green field remain empty
  
  **Tags:** searchkit, formbuilder, autocomplete
  
  > **Comments:**
  > **username_1**: Which version of CiviCRM are you using?  
  > **username_0**: 5.62.1 (I should have said that in the original question, sorry ;)  
  > **username_1**: Could you please try again on the latest (5.64+)? IIRC there have been some fixes in this area recently.  
  > **username_0**: I have just reproduced the problem on https://dmaster.demo.civicrm.org/civicrm/test v 5.66.alpha1  I guess dmaster will be reset in about an hour, but if you connect to this URL  before with the demo admin account, you will see the problem  
  > **username_1**: You're right the demo site didn't last long enough but I'll try to reproduce based on your screenshots...  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-08-22. Score: 2 | Accepted answer
  
  That was indeed a bug in FormBuilder. Multiple bugs in fact. I've fixed them all in this PR: <https://github.com/civicrm/civicrm-core/pull/27121>
  
  You can help by reviewing the PR, you'll find instructions for doing so right under the description (in the comment posted by CiviBot).
  
  > **Comments:**
  > **username_0**: marking this as answered (that was several months ago). Thanks @username_1 !  
  
  ---
  
  