How to save values on each form submit without overriding saved datas? i am having a form with 2 values to save on submit:

 public function submitForm(array &amp;$form, FormStateInterface $form_state) {
    if ($_POST['op'] == 'Import Accounts') {
      $filter = $form_state-&gt;getValue('ldap_filter');
      \Drupal::configFactory()-&gt;getEditable('amu_import_ldap.settings')
        -&gt;set('ldap_filter', $filter)
        -&gt;save();

      $roles = $form_state-&gt;getValue('roles_list');
      \Drupal::configFactory()-&gt;getEditable('amu_import_ldap.settings')
        -&gt;set('roles', $roles)
        -&gt;save();       
      }


It is working but each save override the previous one.

How can i structure the yml to save a list of datas iterately

/config/install/my_module.settings.yml

ldap_filter: ""
roles: null


i have been trying a schema file although i am not sure it if it is considered at all

/config/schema/my_module.schema.yml

amu_import_ldap.settings:
  type: config_object
  label: 'couple filtreLDAP / roles'
  mapping:
    ldap_filter:
      type: text
      label: 'Filtre LDAP'
    role:
      type: array
      label: 'Rôles'


i have seen things like 


  node.type.*:


?
Config items can be arrays, so something like this should work. (Note that I haven't actually set it up to try it).

      $new_filter = $form_state-&gt;getValue('ldap_filter');
      $filters = \Drupal::configFactory()-&gt;getEditable('amu_import_ldap.settings')
        -&gt;get('ldap_filter');
      $filters[] = $new_filter;
      \Drupal::configFactory()-&gt;getEditable('amu_import_ldap.settings')
        -&gt;set('ldap_filter', $filters)
        -&gt;save();


Of course that's a very naive example, you may wish to check you are only adding unique items to the array, and so on.