Using Gravity Forms ‘gform_zapier_sample_field_value’ PHP filter

The gform_zapier_sample_field_value Gravity Forms PHP filter allows you to modify the sample field value before it is sent to Zapier.


add_filter('gform_zapier_sample_field_value', 'your_function_name', 10, 3);


  • $value (string): The sample value to be modified.
  • $form_id (integer): The ID of the form being processed.
  • $field_id (string): The ID of the field being processed.

More information

See Gravity Forms Docs: gform_zapier_sample_field_value


Basic usage

Replace the sample value with a custom value.

add_filter('gform_zapier_sample_field_value', 'zapier_sample_field_value', 10, 3);

function zapier_sample_field_value($value, $form_id, $field_id) {
    return 'the new value';

Email Field Example

Replace the sample value used by the Email type field with your own custom sample value.

add_filter('gform_zapier_sample_field_value', function($value) {
    if ($value === '[email protected]') {
        $value = '[email protected]';
    return $value;

Modify value based on form ID

Change the sample value only for a specific form.

add_filter('gform_zapier_sample_field_value', function($value, $form_id, $field_id) {
    if ($form_id == 5) {
        return 'custom value for form 5';
    return $value;
}, 10, 3);

Modify value based on field ID

Change the sample value only for a specific field.

add_filter('gform_zapier_sample_field_value', function($value, $form_id, $field_id) {
    if ($field_id == '7') {
        return 'custom value for field 7';
    return $value;
}, 10, 3);

Modify value for a specific field type

Change the sample value only for fields of a specific type (e.g., textarea).

add_filter('gform_zapier_sample_field_value', function($value, $form_id, $field_id) {
    $field = GFAPI::get_field($form_id, $field_id);
    if ($field->type == 'textarea') {
        return 'custom value for textarea';
    return $value;
}, 10, 3);