Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello.
I need to get the data from a submited webform, to run my own action process and save in my own tables.
Or... I need to detect a submited webform event to catch the data form the webform tables...
Thanks in advance... (Great Job)
Comments
Comment #1
Augusto182 CreditAttribution: Augusto182 commentedHello. The function i want whit that is this:
(1)
* Have a form to get a code from de users
* Get the code for loguin the user as especific role
(2)
* Get parameter from user
* Make a query on db bases in that parameters
Tanks
Comment #2
Augusto182 CreditAttribution: Augusto182 commented...
Comment #3
Augusto182 CreditAttribution: Augusto182 commentedI find this: http://drupal.org/node/1291574
"Custom coding: Adding advanced validation or submit code" D6 version
My question is: The Webform ID is the same id webform node?
And... this code aply to D7 version?
Comment #4
quicksketchYes to both.
As mentioned in the submission guidelines, I don't provide help with custom coding:
Please refer to other resources such as IRC or Drupal StackExchange to ask your questions.
Comment #5
Augusto182 CreditAttribution: Augusto182 commentedIt works.
This info will be usefull...
Bye
Comment #6
garglalit0 CreditAttribution: garglalit0 commentedTo get the webform submission id in custom form handler
function MODULE_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id)
{
if($form_id== 'webform_submission_add_form')
{
$form['actions']['submit']['#submit'][] = 'MODULE_custom_submit_handler';
}
}
function MODULE_custom_submit_handler(&$form, \Drupal\Core\Form\FormStateInterface $form_state)
{
$webform_submission_id = $form_state->getFormObject()->getEntity()->id();
kint($webform_submission_id );
}
hope this help to get the Webform submission id in custom handler form of webform.
This fix my problem.