I am trying to programatically get the webform submission sid on submitting a webform but failed to get it !
On my customwebformhandler.php file i have the below:
public function submitForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission) {
// Get an array of the values from the submission.
$values = $webform_submission->getData();
// Get the Webform submission "Sid".
$sid = $webform_submission->id();
// Show a success message.
\Drupal::messenger()->addMessage(t("$sid"));
}
but i am not getting any sid value.
any help please ?