To get webform values right after the page submit, they're stored in the global $_POST
variable.
Alternatively you need to load the right webform submission.
Drupal 7
Here is example how to do it in Drupal 7 (as per this post):
module_load_include('inc', 'webform', 'includes/webform.submissions');
$submissions = webform_get_submissions(array('nid'=> 123));
foreach ($submissions as $submission){
foreach ($submission->data as $row=>$data){
print '<pre>'; print_r($row); print '</pre>';
print '<pre>'; print_r($data); print '</pre>';
}
}
Drupal 8
Here is the example to get the webform submission in Drupal 8:
$entity = \Drupal::entityTypeManager()->getStorage('webform')->load('my_webform');
$form = $entity->getSubmissionForm();
$elements = $form['elements'];
Here is the example using drush
:
drush ev 'print_r(\Drupal::entityTypeManager()->getStorage("webform")->load("repairs_taps")->getSubmissionForm()["elements"]);'