Using Gravity Forms ‘gform_export_separator’ PHP action

The gform_export_separator filter allows you to change the column separator character for the entry export file. By default, the separator is a comma (,).

Usage

add_filter('gform_export_separator', 'change_separator', 10, 2);

To target a specific form, add the form id after the filter name:

add_filter('gform_export_separator_6', 'change_separator', 10, 2);

Parameters

  • $separator (string): Value of the separator character to be filtered.
  • $form_id (integer): ID of the current form.

More information

See Gravity Forms Docs: gform_export_separator

Examples

Change separator to a pipe (|)

This example changes the separator to a pipe (|).

add_filter('gform_export_separator', 'change_separator', 10, 2);

function change_separator($separator, $form_id) {
    return '|';
}

Change separator to a tab

This example changes the separator to a tab.

add_filter('gform_export_separator', 'change_separator', 10, 2);

function change_separator($separator, $form_id) {
    return "\t";
}

Change separator to a semicolon (;)

This example changes the separator to a semicolon (;).

add_filter('gform_export_separator', 'change_separator', 10, 2);

function change_separator($separator, $form_id) {
    return ';';
}

Change separator for a specific form

This example changes the separator to a pipe (|) for form with ID 6.

add_filter('gform_export_separator_6', 'change_separator', 10, 2);

function change_separator($separator, $form_id) {
    return '|';
}

Change separator based on form ID

This example changes the separator based on the form ID.

add_filter('gform_export_separator', 'change_separator', 10, 2);

function change_separator($separator, $form_id) {
    if ($form_id == 6) {
        return '|';
    } elseif ($form_id == 7) {
        return "\t";
    } else {
        return $separator;
    }
}

Note: The code should be placed in the functions.php file of your active theme.