Config entity form field with multiple/unlimited cardinality I have a config entity form that has a taxonomy field, and it currently works with 1 term

$form['integration'] = array(
  '#type' =&gt; 'entity_autocomplete',
  '#title' =&gt; 'Integration',
  '#required' =&gt; TRUE,
  '#target_type' =&gt; 'taxonomy_term',
  '#default_value' =&gt; $entity-&gt;getIntegration(),
  '#selection_settings' =&gt; array(
    'target_bundles' =&gt; array(
      'integration',
    ),
  ),
);


That works fine, but I need to be able to select multiple terms, I've tried setting '#cardinality' =&gt; -1, but it's only allowing 1 element. I added a taxonomy field with unlimited cardinality to a content type, then set a breakpoint on the form to see how it was being set up for the page rendering. It looks like it creates a container form element, then I assume iterates over an array containing all the terms? 

I would have thought there would be a way to set the cardinality of an element by making use of field widgets on the config form page, but I'm not sure that's possible.
(Content) fields have cardinality. There is no such concept for form elements.

However, entity_autcomplete does have a #tags flag, which you can see in the getInfo() method of the class: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21Element%21EntityAutocomplete.php/function/EntityAutocomplete%3A%3AgetInfo/8.

If you set that to TRUE, then it allows you to select a comma-separated list of references.

If you're looking for the "Add another" functionality of entity_autocomplete or any other form element, then you have to build it yourself.