I've created a custom entity module, and the form for it uses field_collections. The only form field I've defined programmatically is the title, the rest of the fields and field collections for this form I've defined via the Drupal 8 interface.
I have a particular field collection with 8 dropdowns and a large textarea. I want the person using the form to be able to set the 8 dropdowns to certain values automatically based on the contents entered in the textarea, but only by clicking a button since they should also be able to manually set the dropdowns. The field_collection itself has unlimited allowed values, so there should be one button for each instance of that field collection in the form.