get values form an entity drupal 8 code example Example: drupal 8 get form entity $entity = $form_state->getFormObject()->getEntity();