How to grab $form_state value from text-format from drupal form I created a form for my module. I have a formatted text box 

$form['message'] = array(
'#type' =&gt; 'text_format',
'#title' =&gt; 'Body',
'#format' =&gt; 'basic_html',
'#default_value' =&gt; '&lt;p&gt;The quick brown fox jumped over the lazy dog.&lt;/p&gt;',
);


When I try to save the form message comes back as an array and I don't know how to pull the value out of it.

public function submitForm(array &amp;$form, FormStateInterface $form_state) {
    parent::submitForm($form, $form_state);
    \Drupal::logger('td')
      -&gt;notice('text: @message', array('@message' =&gt; $form_state-&gt;getValue('message'),));
  }
Try with:

$message = $form_state-&gt;getValue('message')['value'];