How to get Webform Field data for a custom module? I'm trying to set up a view permission based on a webform field.  I've been able to get to my custom module using hook_webform_submission_access().

So I have an email field in the webform, and I want to check that based on the current user's email address.  Should be pretty simple, I just can't get the field data.  Anyone know?

Example:

if ($submission-&gt;data['field_email'] == $user-&gt;mail)


What is the correct syntax instead of $submission->data['field_email']

I'm on Drupal 7 and Webform 4.x branch.
Provided Token is installed, you can use token_replace to access Webform submission values by field name.

$email = token_replace('[submission:values:email]', array('webform-submission' =&gt; $submission));


Note: The Devel module can be useful for exploring object properties and tokens (among other things).