Webform add data along with submitted values I'm using Webform 6x 3.11 and have passed a nodeID into a hidden field called hidden_key. I have created a custom module to implement hook_form_alter() whereby I am trying to add additional data (along with the data that is being submitted) to the submission results.

This additional data is based on some calculations performed on the value in the hidden field, ie: getting some details about the node based on the nodeID. Here's what I currently have:

&lt;?php
    function custom_form_proc_form_alter(&amp;$form, &amp;$form_state, $form_id) {
        if ($form_id == 'webform_client_form_33') {
            $form['#submit'][] = 'custom_form_proc_submit';
        }
    }

    function custom_form_proc_submit($form, &amp;$form_state) {
        $node = node_load($form_state['values']['hidden_key']);
        $pool_title = $node-&gt;title;
        $pool_category = $node-&gt;field_category[0]['value'];

        // ?????
    }
?&gt;


Where you see my ????? is where I am stuck. Along with whatever data gets submitted with the form, I would like to add these 2 custom fields to the submission results so that it looks like:

Fullname: Mr So-and-So
Email Address: someone@test.com
Pool Category: $pool_category
Pool Title: $pool_title
Availability: Yes

I would really appreciate your help! Thank you!
For webform submission it is best to use hook_webform_submission_insert($node, $submission).
$submission-&gt;data will contain all the submitted values arranged against form components ids.

See my implementation how I arranged a webform as user register form.

function user_register_webform_submission_insert($node, $submission){
// Load information about form components
$comps = $node-&gt;webform['components'];
$fields = array();

//Extract the component info to get form_key=&gt;cid to resolve relation
foreach($comps as $cid =&gt; $comp_info){
    $fields[$comp_info['form_key']] = $cid;
}

// Load the submitted data (field values)
$data = $submission-&gt;data;

//Prepare a user info
$user = array(
    'mail' =&gt; $data[$fields['mail']]['value'][0],
    'name' =&gt; $data[$fields['name']]['value'][0],
    'pass' =&gt; user_password(8),
    'status' =&gt; 1,
    'init' =&gt; $data[$fields['mail']]['value'][0],
    'roles' =&gt; array(2, 3),
);

$account = user_save(null, $user);  
}