I am attempting to use PHP in Drupal rules to update the values in submitted webform submissions. I can access and view the data correctly. When I assign a new value to a field it will even show up correctly if I use print $submission->data; But when I navigate to the submission results page the field hasn't been updated.
I have tried using the webform_submission_update() function to push my change but still no luck.
Question: How do I programmatically update an existing submitted webform submission in Drupal?
$submission = webform_menu_submission_load($nid, $sid); // Two ways I've tried to update the data $submission->data = "testwork"; $submission->data['value'] = 'Declined'; // If I do print $submission->data; it will show the new value. webform_submission_update($nid, $submission);