I have managed to create a table of webform submissions of a particular type, thanks to the answer from a question posted here. What I would like to do now is add a link for each webform submission, and I can't figure out how.
I tried looking through the API, and found a toUrl function, but I don't understand how to use it to get the link for each webform submission. Once I have the link, I would like to combine it with the rest of its info in submission_data[] for display in the table.
Thanks in advance!
$query = \Drupal::entityQuery('webform_submission')
->condition('webform_id', 'sign_up');
$result = $query->execute(); // Gives me IDs associated with the "sign_up" webform.
$storage = \Drupal::entityTypeManager()->getStorage('webform_submission');
$submissions = $storage->loadMultiple($result);
$submission_data = array();
foreach ($submissions as $submission) {
$submission_data[] = $submission->getData();
}
// $submission_data now contains all the submissions from "sign_up" webform.
How do I add a link to the webform submission? When I look through submission_data[] it doesn't contain the ID of the webform submission