0

How can I access the form data during or after submission?

Am using Webform REST for the submission of forms, but I don't seem to be able to retrieve the form data.

For now, I tried the following which gives me empty results:

function module_webform_submission_form_alter(array &$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  \Drupal::logger("module.webform.data")->notice(json_encode($form_state, true));
}

I tried using HOOK form submit but it does not log anything at all. In fact, it looks like this hook is not triggered.

function module_webform_submit($form, \Drupal\Core\Form\FormStateInterface $form_state) {
  \Drupal::logger("module.webform.form_state")->notice(json_encode($form_state, true));
} 

How can I access the form data during or after submission?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.