gform_{$SHORT_SLUG}_field_value

gform_{$SHORT_SLUG}_field_value

DescriptionShort Slug ValuesUsageParametersExamples1. ActiveCampaign – Use Choice Text Instead of Value2. ActiveCampaign – Replace Commas with Pipes3. Emma – Format Checkbox Field4. Help Scout – Change Value of Specific Field5. Zoho CRM – Format Date Field6. Zoho CRM – Format Checkbox FieldPlacementSinceSource Code

Description
This filter can be used to modify a value before it is sent to a third-party by one of the Add-On Framework based add-ons. If you want to filter the value for any add-on you can use gform_addon_field_value.
Short Slug Values
The Gravity Forms Add-On Slugs article lists the available short slugs to use with this hook:
The following add-ons listed in the slug article do not use the hook:

Gravity Forms CLI Add-On
Gravity Forms Debug Add-On
Gravity Forms Gutenberg Add-On

The Zapier Add-On implements its own version of the hook:

gform_zapier_field_value

Usage
The base filter which would run for all forms and all fields would be used like so:
1add_filter( 'gform_helpscout_field_value', 'your_function_name', 10, 4 );
To target a specific form append the form id to the hook name. (format: gform_{$SHORT_SLUG}_field_value_FORMID)
1add_filter( 'gform_helpscout_field_value_10', 'your_function_name', 10, 4 );
To target a specific field append both the form id and the field id to the hook name. (format: gform_{$SHORT_SLUG}_field_value_FORMID_FIELDID)
1add_filter( 'gform_helpscout_field_value_10_3', 'your_function_name', 10, 4 );

Parameters

$value string
The value to be modified.

$form Form Object
The form currently being processed.

$entry Entry Object
The entry currently being processed.

$field_id string
The ID of the field currently being processed.

Examples
1. ActiveCampaign – Use Choice Text Instead of Value
This example shows how you can replace the value of a choice based survey field with the choice text.
1234567891011add_filter( 'gform_activecampaign_field_value', 'gf_get_choice_text', 10, 4 );function gf_get_choice_text( $value, $form, $entry, $field_id ) {    gf_activecampaign()->log_debug( __METHOD__ . '(): running.' );    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->type == 'survey' ) {        $value = $field->get_value_export( $entry, $field_id, true );        gf_activecampaign()->log_debug( __METHOD__ . '(): Value: ' . $value );    }    return $value;}
2. ActiveCampaign – Replace Commas with Pipes
This example shows how you can replace the commas used to separate checkbox or multi select choices with pipe characters.
123456789101112add_filter( 'gform_activecampaign_field_value', 'gf_replace_commas_with_pipes', 10, 4 );function gf_replace_commas_with_pipes( $value, $form, $entry, $field_id ) {    gf_activecampaign()->log_debug( __METHOD__ . '(): running.' );    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && ( $field->type == 'checkbox' || $field->type == 'multiselect' ) ) {        $value = str_replace( ', ', '||', $value );        gf_activecampaign()->log_debug( __METHOD__ . '(): Value: ' . $value );    }     return $value;}
3. Emma – Format Checkbox Field
This example shows how you can reformat the checkbox field value to be passed as an array instead of a string.
123456789add_filter( 'gform_emma_field_value', function ( $value, $form, $entry, $field_id ) {    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->get_input_type() === 'checkbox' ) {        $value = explode( ', ', $value );    }     return $value;}, 10, 4 );
4. Help Scout – Change Value of Specific Field
This example shows how you can change the value of field 3 on form 10 before it is passed to Help Scout.
1234add_filter( 'gform_helpscout_field_value_10_3', function ( $value, $form, $entry, $field_id ) {     return 'your new value';}, 10, 4 );
5. Zoho CRM – Format Date Field
This example shows how you can reformat the entry date from yyyy-mm-dd to the format configured on the field.
123456789add_filter( 'gform_zohocrm_field_value', function ( $value, $form, $entry, $field_id ) {    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->type == 'date' ) {        $value = GFCommon::date_display( $value, $field->dateFormat );    }     return $value;}, 10, 4 );
6. Zoho CRM – Format Checkbox Field
This example shows how you can reformat the checkbox field value to pass true or false instead of the choice. This snippet is not needed if you』re using version 1.8 of the add-on or newer.
1234567891011add_filter( 'gform_zohocrm_field_value', function ( $value, $form, $entry, $field_id ) {    gf_zohocrm()->log_debug( __METHOD__ . '(): Running...' );    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->get_input_type() === 'checkbox' ) {        gf_zohocrm()->log_debug( __METHOD__ . '(): Checkbox value to true or false.' );        $value = $value ? 'true' : 'false';    }     return $value;}, 10, 4 );
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 1.9.10.11.
Source Code
1234gf_apply_filters( "gform_{$slug}_field_value", array(    $form['id'],    $field_id), $field_value, $form, $entry, $field_id );
This filter is located in GFAddOn::maybe_override_field_value() in includes/addon/class-gf-addon.php.

gform_gf_field_create

gform_gf_field_create

DescriptionUsageParametersExamples1. Create GF_Field object based on 「type」 property (rather than 「inputType」 property)Source CodeSince

Description
Use this filter to modify or replace the GF_Field object after it has been created.
Usage
1add_filter( 'gform_gf_field_create', 'my_custom_function', 10, 2 );

Parameters

$field GF_Field
A GF_Field object of the type specified by the $properties['type'] or $properties['inputType'] properties.

$properties array
An array of field properties that will be used to generate the GF_Field object.

Examples
1. Create GF_Field object based on 「type」 property (rather than 「inputType」 property)
1234567add_filter( 'gform_gf_field_create', 'my_custom_function', 10, 2 );function my_custom_function( $field, $properties ) {    if( $field->type == 'myCustomFieldType' ) {        $field = new GF_My_Custom_Field_Type( $properties );    }    return $field;}
Source Code
This filter is located in GF_Fields::create() in includes/addon/class-gf-fields.php.
Since
This filter was added in Gravity Forms 2.0.

gform_form_validation_errors

gform_form_validation_errors

DescriptionUsageParametersExamples1. Add a new errorPlacementSinceSource Code

Description
The gform_form_validation_errors filter enables the list of validation errors, which will be displayed at the top of the form, to be overridden.
Usage
add_filter( 'gform_form_validation_errors', 'your_function_name', 10, 2 );

You can also specify this per form by adding the form id after the filter name.
add_filter( 'gform_form_validation_errors_6', 'your_function_name', 10, 2 );

Parameters

$errors array
An array of field validation errors. The following keys will be defined for each error: field_label, field_selector, and message.

$form Form Object
The current form object.

Examples
1. Add a new error
add_filter( 'gform_form_validation_errors', function( $errors, $form ) {
$errors[] = array( 'field_label' => 'the field label here', 'field_selector' => '#field_1_10', 'message' => 'the error message here' );

return $errors;
}, 10, 2 );

Placement
This code should be placed in the functions.php file of your active theme or a custom functions plugin.
Since
This filter was added in Gravity Forms v2.5.
Source Code
This filter is located in GFFormDisplay::get_validation_errors() in form_display.php.

gform_form_summary

gform_form_summary

DescriptionParametersExamplesOrder Forms By Total EntriesPlacementSinceSource Code

Description
Filters through and allows modification of the forms displayed in the Dashboard Forms widget.
Parameters

$forms array
Array containing all forms, including the unread entries count, total entries count and date of last entry submission.

Examples
Order Forms By Total Entries
12345678910add_filter( 'gform_form_summary', 'order_form_summary_by_total_entries', 10, 1 );function order_form_summary_by_total_entries( $forms ) {     usort( $forms, function( $a, $b ) {        return $b['total_entries'] - $a['total_entries'];    } );     return $forms; }
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms version 2.4.16.
Source Code
This filter is located in GFFormsModel::get_form_summary in forms_model.php

gform_frontend_feed_deactivated

gform_frontend_feed_deactivated

DescriptionUsageParametersPlacementSinceSource Code

Description
The 「gform_frontend_feed_deactivated」 JavaScript action in Gravity Forms fires after the conditional logic on the form has been evaluated and the feed has become inactive, allowing further actions to be performed.
Usage
The following would apply to all forms:
12345gform.addAction('gform_frontend_feed_deactivated', function (feeds, formId)   {      //do something  });
To target a specific form, append the form id to the hook name. (format: gform_frontend_feed_deactivated_FORMID)
12345gform.addAction('gform_frontend_feed_deactivated_1', function (feeds, formId)   {      //do something  });
To target a specific add-on, include the slug for the add-on after the 「gform」 text (format: gform_SLUG_frontend_feed_deactivated)
12345gform.addAction('gform_gravityformsstripe_frontend_feed_deactivated', function (feeds, formId)   {      //do something  });
To target a specific form and add-on, append the form id to the hook name, and include the slug for the add-on after the 「gform」 text (format: gform_SLUG_frontend_feed_deactivated_FORMID)
12345gform.addAction('gform_gravityformsstripe_frontend_feed_deactivated_1', function (feeds, formId)   {      //do something  });

Parameters

$feeds Feed Object
An array of feed objects.

$formId int
The form id.

Placement
Your code snippet can be placed in a HTML field on your form or in a theme custom JavaScript file.
Since
This action was added in Gravity Forms 2.4
Source Code
This filter is located in GFFrontendFeeds.deactivateFeed() includes/addon/js/gaddon_frontend.js

gform_format_option_label

gform_format_option_label

DescriptionUsageParametersExamplesRemove Price from LabelDisplay Price before LabelShow Option Price instead of Variable PricingPlacementSource Code

Description
This filter is executed when calculating and displaying the pricing on product option fields or shipping fields set as drop down field or radio buttons type. Use this filter to change the format of the choice labels for these field types.
Usage

Parameters

fullLabel string
The default label that will be displayed for the current option. It has the field choice label as well as the calculated price. (i.e. My Option +$5.00)

fieldLabel string
The field/option label without the price. (i.e. My Option)

priceLabel string
The price text without the field label. (i.e. +$5.00)

selectedPrice float
The price of the currently selected option.

price float
The price of this option. (The option that this label applies to)

formId integer
The current form ID.

fieldId integer
The current field ID.

Examples
Remove Price from Label
The following example disables the option pricing, displaying only the option label.

Display Price before Label
The following example changes the order of the labels, displaying the option price before the field label. I only does that for form ID 5.

Show Option Price instead of Variable Pricing
This example replaces the variable pricing with the static full option price for a field with id 43.

Placement
This code should be placed in an HTML field on your form or you may use the gform_pre_render hook to echo the script block to the page.
Source Code
This filter is located in gravityforms.js

gform_form_switcher_forms

gform_form_switcher_forms

DescriptionParametersExamplesDisplay First Ten FormsPlacementSinceSource Code

Description
Filters through and allows modification of the forms displayed in the Form Switcher dropdown.
Parameters

$forms array
Array containing all forms, sorted by title.

Examples
Display First Ten Forms
add_filter( 'gform_form_switcher_forms', 'limit_form_switcher_forms', 10, 1 );
function limit_form_switcher_forms( $forms ) {
return array_splice( $forms, 0, 10 );
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms version 2.4.16.
Source Code
This filter is located in GFForms::form_switcher in gravityforms.php

gform_frontend_feeds_evaluated

gform_frontend_feeds_evaluated

DescriptionUsageParametersPlacementSinceSource Code

Description
The 「gform_frontend_feeds_evaluated」 JavaScript action in Gravity Forms fires after the conditional logic on the form has been evaluated, allowing further actions to be performed.
Usage
The following would apply to all forms:
12345gform.addAction('gform_frontend_feeds_evaluated', function (feeds, formId)   {      //do something  });
To target a specific form, append the form id to the hook name. (format: gform_frontend_feeds_evaluated_FORMID)
12345gform.addAction('gform_frontend_feeds_evaluated_1', function (feeds, formId)   {      //do something  });
To target a specific add-on, include the slug for the add-on after the 「gform」 text (format: gform_SLUG_frontend_feeds_evaluated)
12345gform.addAction('gform_gravityformsstripe_frontend_feeds_evaluated', function (feeds, formId)   {      //do something  });
To target a specific form and add-on, append the form id to the hook name, and include the slug for the add-on after the 「gform」 text (format: gform_SLUG_frontend_feeds_evaluated_FORMID)
12345gform.addAction('gform_gravityformsstripe_frontend_feeds_evaluated_1', function (feeds, formId)   {      //do something  });

Parameters

$feeds Feed Object
An array of feed objects.

$formId int
The form id.

Placement
Your code snippet can be placed in a HTML field on your form or in a theme custom JavaScript file.
Since
This action was added in Gravity Forms 2.4
Source Code
This filter is located in GFFrontendFeeds.evaluateFeeds() includes/addon/js/gaddon_frontend.js

gform_forms_post_import

gform_forms_post_import

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Use this hook to perform actions after importing forms.
Usage
add_action( 'gform_forms_post_import', 'your_function_name' );

Parameters

$forms Form Object
An array of form objects.

Example
This example shows how you can display a message after importing forms.
add_action( 'gform_forms_post_import', 'my_action_gform_forms_post_import' );
function my_action_gform_forms_post_import( $forms ) {
GFCommon::add_message( 'Change the sample values' );
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This hook was added in Gravity Forms 1.9.13.29.
Source Code
do_action( 'gform_forms_post_import', $forms )
This action hook is located in GFExport::import_json() in export.php.

gform_form_tag

gform_form_tag

DescriptionUsageParametersExamplesSubmit Form to Custom HandlerTurn off autocompletionPlacementSource CodeThird-party ResourcesPlugin: Gravity Forms Tag Editor

Description
This filter is executed when the form is displayed and can be used to completely change the form tag (i.e.

).
Usage
1add_filter( 'gform_form_tag', 'form_tag', 10, 2 );
Parameters

$form_tag string
The string containing the

tag

$form Form Object
The current form.

Examples
Submit Form to Custom Handler
This example changes the action of the form tag, submitting the form to a custom form handler.
123456789add_filter( 'gform_form_tag', 'form_tag', 10, 2 );function form_tag( $form_tag, $form ) {    if ( $form['id'] != 3 ) {        //not the form whose tag you want to change, return the unchanged tag        return $form_tag;    }    $form_tag = preg_replace( "|action='(.*?)'|", "action='custom_handler.php'", $form_tag );    return $form_tag;}
Turn off autocompletion
Turn off autocompletion as described in Mozilla developer docs: How to Turn Off Form Autocompletion
The following will be applied only to a form with id 1.
12345678910add_filter( 'gform_form_tag', 'form_tag', 10, 2 );function form_tag( $form_tag, $form ) {if ( $form['id'] != 1 ) { // change 1 to match your form id//not the form whose tag you want to change, return the unchanged tagreturn $form_tag;}// Turn off autocompletion as described here https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion$form_tag = preg_replace( "|action='|", "autocomplete='off' action='", $form_tag );return $form_tag;}
If you want to apply it to all forms simply remove the if statement.
123456add_filter( 'gform_form_tag', 'form_tag', 10, 2 );function form_tag( $form_tag, $form ) {// Turn off autocompletion as described here https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion$form_tag = preg_replace( "|action='|", "autocomplete='off' action='", $form_tag );return $form_tag;}
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFFormDisplay::get_form() in form_display.php
Third-party Resources
Plugin: Gravity Forms Tag Editor
A simple plugin that makes modifying Gravity Forms tags a breeze. Change any attribute of the form tag with just a few lines of code. Visit the plugin page.