I need to access the submission id (sid) in my rule, but it's not included in the $data variable.

Adding the following snippet at line 37 in the webform_rules_client_form_submit function in webform_rules.module works, but surely there's a better way....

  // Add details to $data array.
  foreach ($form_state['values']['details'] as $detail => $value) {
    $data[$detail]['name'] = $detail;
    $data[$detail]['value'] = $value;
  }

Comments

stborchert’s picture

Status: Active » Needs review

Hi.
You can either use the token [data:sid] or print it with <?php $data['sid']; ?>.
I've checked this with the latest dev and it works using <?php dpm(array($data, '[data:sid]'));?>.

Result: https://img.skitch.com/20111119-fncdjw323irf94w8hqn7w3hnq6.png

jesss’s picture

Status: Needs review » Fixed

That works -- thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.