You are here

function hook_webform_csv_data_alter in Webform 6.3

Same name and namespace in other branches
  1. 7.4 webform.api.php \hook_webform_csv_data_alter()
  2. 7.3 webform.api.php \hook_webform_csv_data_alter()

Alter a Webform submission's data when exported.

Related topics

1 invocation of hook_webform_csv_data_alter()
webform_results_export in includes/webform.report.inc
Generate a Excel-readable CSV file containing all submissions for a Webform.

File

./webform.api.php, line 288
Sample hooks demonstrating usage in Webform.

Code

function hook_webform_csv_data_alter(&$data, $component, $submission) {

  // If a value of a field was left blank, use the value from another
  // field.
  if ($component['cid'] == 1 && empty($data)) {
    $data = $submission->data[2]['value'][0];
  }
}