Access table form field's data from submitForm I'm building a custom form and it display well. My form has a table type field which I can't manage to access from the submitForm method. 

public function buildForm(array $form, FormStateInterface $form_state)
{
    $form['name'] = [
        '#type' =&gt; 'textfield',
        '#title' =&gt; $this-&gt;t('Name'),
        '#required' =&gt; true,
    ];

    $form['template_components_list'] = [
        '#type' =&gt; 'table',
        '#caption' =&gt; $this
        -&gt;t('My table.'),
        '#tree' =&gt; TRUE,
        '#header' =&gt; array(
            $this
            -&gt;t('row_name'),
            $this
            -&gt;t('description'),
            $this
            -&gt;t('actions'),
        ),
    ];

    $form['template_components_list'][0]['row_name'] = array(
        '#plain_text' =&gt; 'Test1',
    );

    $form['template_components_list'][1]['row_name'] = array(
        '#plain_text' =&gt; 'Test2',
    );

    $form['actions'] = [
                '#type' =&gt; 'actions',
            ];
    // Add a submit button that handles the submission of the form.
    $form['actions']['submit'] = [
                '#type' =&gt; 'submit',
                '#value' =&gt; $this-&gt;t('Submit'),
            ];

    return $form;
}


I'm then trying to access the values in submitForm from multiple ways (some creating errors but I want to show I tried them)

public function submitForm(array &amp;$form, FormStateInterface $form_state)
{
    \Drupal::logger('some_channel_name')-&gt;warning('&lt;pre&gt;&lt;code&gt;' . print_r('START', TRUE) . '&lt;/code&gt;&lt;/pre&gt;');
    \Drupal::logger('some_channel_name')-&gt;warning('&lt;pre&gt;&lt;code&gt;' . print_r($form_state-&gt;getValue('row_name'), TRUE) . '&lt;/code&gt;&lt;/pre&gt;');
    \Drupal::logger('some_channel_name')-&gt;warning('&lt;pre&gt;&lt;code&gt;' . print_r($form_state-&gt;get('row_name'), TRUE) . '&lt;/code&gt;&lt;/pre&gt;');
    \Drupal::logger('some_channel_name')-&gt;warning('&lt;pre&gt;&lt;code&gt;' . print_r($form_state-&gt;get('row_name')-&gt;getValue(), TRUE) . '&lt;/code&gt;&lt;/pre&gt;');
    \Drupal::logger('some_channel_name')-&gt;warning('&lt;pre&gt;&lt;code&gt;' . print_r($form_state-&gt;getValue('template_components_list'), TRUE) . '&lt;/code&gt;&lt;/pre&gt;');
    \Drupal::logger('some_channel_name')-&gt;warning('&lt;pre&gt;&lt;code&gt;' . print_r($form_state-&gt;get('template_components_list'), TRUE) . '&lt;/code&gt;&lt;/pre&gt;');
    \Drupal::logger('some_channel_name')-&gt;warning('&lt;pre&gt;&lt;code&gt;' . print_r($form_state-&gt;get('template_components_list')-&gt;getValue(), TRUE) . '&lt;/code&gt;&lt;/pre&gt;');
    \Drupal::logger('some_channel_name')-&gt;warning('&lt;pre&gt;&lt;code&gt;' . print_r('END', TRUE) . '&lt;/code&gt;&lt;/pre&gt;');
}


}

I got only empty messages or errors in my logs


  Error: Call to a member function getValue() on null 


What is the good way to access my table rows values from submitForm ?
Sorry, I must have overlooked the way you built the form. Unless you make your values in the table row part of the form, you cannot submit them. I changed the row '#type' to a text field and added a default value, in that way you can now pass that along with your form. 
Try this:

public function buildForm(array $form, FormStateInterface $form_state)
{
    $form['name'] = [
        '#type' =&gt; 'textfield',
        '#title' =&gt; $this-&gt;t('Name'),
        '#required' =&gt; true,
    ];

    $form['template_components_list'] = [
        '#type' =&gt; 'table',
        '#caption' =&gt; $this
        -&gt;t('My table.'),
        '#tree' =&gt; TRUE,
        '#header' =&gt; array(
            $this
            -&gt;t('row_name'),
            $this
            -&gt;t('description'),
            $this
            -&gt;t('actions'),
        ),
    ];

    $form['template_components_list'][0]['row_name'] = array(
        '#type' =&gt; 'textfield',
         '#default_value' =&gt; 'Test1'

    );

    $form['template_components_list'][1]['row_name'] = array(
              '#type' =&gt; 'textfield',
         '#default_value' =&gt; 'Test2'

    );

    $form['actions'] = [
                '#type' =&gt; 'actions',
            ];
    // Add a submit button that handles the submission of the form.
    $form['actions']['submit'] = [
                '#type' =&gt; 'submit',
                '#value' =&gt; $this-&gt;t('Submit'),
            ];

    return $form;
}



public function submitForm(array &amp;$form, FormStateInterface $form_state)
{

   $SubmittedValues = $form_state-&gt;getValues();
   print_r($SubmittedValues);
   //Now you can access the form values as an associative array 
    \Drupal::logger('some_channel_name')-&gt;warning('&lt;pre&gt;&lt;code&gt;' . print_r('START', TRUE) . '&lt;/code&gt;&lt;/pre&gt;');
    \Drupal::logger('some_channel_name')-&gt;warning('&lt;pre&gt;&lt;code&gt;' . print_r($SubmittedValues['row_name'], TRUE) . '&lt;/code&gt;&lt;/pre&gt;');

    \Drupal::logger('some_channel_name')-&gt;warning('&lt;pre&gt;&lt;code&gt;' . print_r($SubmittedValues['template_components_list'], TRUE) . '&lt;/code&gt;&lt;/pre&gt;');

    \Drupal::logger('some_channel_name')-&gt;warning('&lt;pre&gt;&lt;code&gt;' . print_r('END', TRUE) . '&lt;/code&gt;&lt;/pre&gt;');
}