$form_state->set(), $form_state->setValue() doesn't save new value Below you could find my code. It works fine until below the comment. I also tried countless combination of $form_state-&gt;saveValue(), but nothing works. Any ideas?
    function myforms_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {
      if ($form_id == 'commerce_product_default_edit_form' || $form_id == 'commerce_product_default_add_form') {
        $form['#submit'][] = 'myforms_extra_submit_handler';
      }
    }

    function myforms_extra_submit_handler($form, FormStateInterface $form_state) {
      $events_dates = $form_state-&gt;getFormObject()-&gt;getEntity()-&gt;get('event_date')-&gt;getValue();
      $count = count($events_dates);
      if (empty($events_dates[$count-1])){
        $count = $count - 1;
      }
      if ($count &gt; 0) {
        $start_date = date(&quot;j/n/y&quot;, strtotime($events_dates[0]['value']));
        $end_date = date(&quot;j/n/y&quot;, strtotime($events_dates[$count-1]['end_value']));
        if ($count == 1) {
          $count_suffix = &quot;zjazd&quot;;
        } else if ($count == 2 || $count == 3) {
          $count_suffix = &quot;zjazdy&quot;;
        } else {
          $count_suffix = &quot;zjazdów&quot;;
        }
        $date = $start_date.' - '.$end_date.' ('.$count.' '.$count_suffix.')';

        $title = $form_state-&gt;getFormObject()-&gt;getEntity()-&gt;get('title')-&gt;getValue()[0]['value'];
        /* code above works, below is the code which doesn't */
        $form_state-&gt;set('title', $title.$date);
        $form['elements']['title']['#value'] = $title.$date;
        $form['elements']['title']['#default_value'] = $title.$date;
        $form_state-&gt;setRebuild();
      }
    }
I assume with code works you mean you get the updated title value. Then another submit handler has already transferred the values to the entity and your changes to $form_state are too late.
So you can try to position your submit handler first:
array_unshift($form['#submit'], 'myforms_extra_submit_handler');

or update the entity instead of $form_state:
$entity = $form_state-&gt;getFormObject()-&gt;getEntity(); 
$title = $entity-&gt;get('title')-&gt;value;
$entity-&gt;set('title', $title . $date);

Caveat: Normally submit handlers in entity forms are attached to submit buttons. So you might want to check first all submit handlers which are active in the form before you decide where to place your submit handler.

Different approach
You are asking why your submit handler is not working and there is definitely a solution for that, but there is probably a much easier solution outside of the form when the form is trying to save the entity. See  Programmatically update a field&#39;s value