How can I load a webform submission programmatically ?
I've tried :
$webform_submission = WebformSubmission::load($sid);
but it return null.
I do this in a custom module call by an handler after webform submission.
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
I think you have to load sid like below
// Load submission using sid. /** @var \Drupal\webform\WebformSubmissionInterface $webform_submission */ $webform_submission = \Drupal\webform\Entity\WebformSubmission::load($sid);