Managing Notes with the GFAPI

Managing Notes with the GFAPI

Introductionget_notesParametersReturnsUsage ExamplesGetting all notes for the specified entryget_noteParametersReturnsUsage Exampleadd_noteParametersReturnsUsage ExamplesAdding a user notedelete_noteParametersReturnsUsage Exampleupdate_noteParametersReturnsUsage ExamplesUpdating the note content

Introduction
The GFAPI methods for managing notes were added in Gravity Forms 2.4.18.
See the GFAPI article for other available methods.

get_notes
Returns the notes for the given search criteria.
public static function get_notes( $search_criteria = array(), $sorting = null ) {}
Parameters

$search_criteria array
Optional. An array containing one or more of the following arguments.

id int
The ID of the note to be retrieved.
entry_id int
The ID of the entry the notes are to be retrieved for.
user_id int
The ID of the user the notes are to be retrieved for.
user_name string
The user_name of the user the notes are to be retrieved for.
note_type string
The type of note to be retrieved.
sub_type string
The sub type of note to be retrieved.
start_date string
Retrieves notes created on or after the date and time specified in the Y-m-d H:i:s format.
end_date string
Retrieves notes created before the date and time specified in the Y-m-d H:i:s format.

$sorting array
Optional. An array containing the sorting arguments.

key string
The column to sort by. See the gf_entry_notes database table columns.
direction string
The direction to sort by: ASC or DESC.

The default sorting arguments are defined like so:
$sorting = array( 'key' => 'id', 'direction' => 'ASC' );

Returns

$result bool|array
False or an array of note objects containing the gf_entry_notes database table columns as properties.

Usage Examples
Getting all notes for the specified entry
$search_criteria = array( 'entry_id' = $entry_id );
$result = GFAPI::get_notes( $search_criteria );

get_note
Returns the specified note.
public static function get_note( $note_id ) {}
Parameters

$note_id int
The ID of the note to be retrieved.

Returns

$result WP_Error|object
A WP_Error if the note was not found or the note object containing the gf_entry_notes database table columns as properties.

Usage Example
$result = GFAPI::get_note( $note_id );

add_note
Adds a note to the specified entry.
public static function add_note( $entry_id, $user_id, $user_name, $note, $note_type = 'user', $sub_type = null ) {}
Parameters

$entry_id int
The ID of the entry the note is being added to.

$user_id int
The ID of the user adding the note.

$user_name string
The user_name of the user adding the note.

$note string
The content of the note being added.

$note_type string
Optional. The type of note being added.

$sub_type string
Optional. The sub type of note being added.

Returns

$result WP_Error|int
A WP_Error if an error occurs or the ID of the note returned by the database.

Usage Examples
Adding a user note
$result = GFAPI::add_note( $entry_id, $user_id, $user_name, 'this is a test note' );

delete_note
Deletes the specified note.
public static function delete_note( $note_id ) {}
Parameters

$note_id int
The ID of the note to be retrieved.

Returns

$result WP_Error|bool
A WP_Error if an error occurs or true on success.

Usage Example
$result = GFAPI::delete_note( $note_id );

update_note
Updates the specified note.
public static function update_note( $note, $note_id = '' ) {}
Parameters

$note array
An array containing one or more of the following arguments.

id int
The ID of the note to be updated.
entry_id int
The ID of the entry the note is for.
user_id int
The ID of the user the note was added by.
user_name string
The user_name of the user the note was added by.
date_created string
The date the note was created in the Y-m-d H:i:s format.
value string
The note content.
note_type string
The note type.
sub_type string
The note sub type.

$note_id string|int
Optional. The ID of the note to be updated when not included in the $note array.

Returns

$result WP_Error|bool
A WP_Error if an error occurs or true on success.

Usage Examples
Updating the note content
$note = array( 'value' = 'the updated note' );
$result = GFAPI::update_note( $note, $note_id );

Adding a New Notification Service Using the Add-On Framework

Adding a New Notification Service Using the Add-On Framework

IntroductionThe HooksAdd the ServiceIntercept the NotificationSend the EmailFurther Reading

Introduction
Gravity Forms 1.9.16 added the ability for the user to select which service is used to send the notification; on a default install only WordPress (wp_mail()) will be available.
The Hooks
Adding a new service can be accomplished using a minimum of two hooks in the init function of your add-on.
1234567891011/** * Plugin starting point. Handles hooks, loading of language files, and PayPal delayed payment support. */public function init() {     parent::init();     add_filter( 'gform_notification_services', array( $this, 'add_notification_service' ) );    add_filter( 'gform_pre_send_email', array( $this, 'maybe_send_email' ), 19, 3 ); }
Add the Service
The gform_notification_services filter is used to add the new choice to the 「Email Service」 setting on the edit notification page.
This example assumes that your add-on has an initialize_api() function used to include the API files and connect to the service to validate any API credentials. If the credentials are valid, the choice for the new service will be added.
12345678910111213141516171819/** * Add the new notification service. * * @param array $services The notification services. * * @return array */public function add_notification_service( $services ) {     // If the API can be initialized, add the service.    if ( $this->initialize_api() ) {        $services['the_service_name'] = array(            'label' => esc_html__( 'The Service Name', 'sometextdomain' ),            'image' => $this->get_base_url() . '/images/icon.png',        );    }     return $services;}
Intercept the Notification
The gform_pre_send_email filter is used to intercept the notification email, pass the email to the new service, and then prevent WordPress and other add-ons from also sending the email.
1234567891011121314151617181920212223242526272829303132/** * If the notification "Email Service" setting is a match prepare to send the email. * * @param array $email The email properties. * @param string $message_format The message format, html, or text. * @param array $notification The Notification object which produced the current email. * * @return array */public function maybe_send_email( $email, $message_format, $notification ) {     // If the notification is not assigned to this service or the service API is not initialized, return the email.    if ( rgar( $notification, 'service' ) !== 'the_service_name' || ! $this->initialize_api() ) {        return $email;    }     // If the email has already been aborted, return the email.    if ( $email['abort_email'] ) {        $this->log_debug( __METHOD__ . '(): Not sending email because the notification has already been aborted by another Add-On.' );         return $email;    }     $result = $this->send_email( $email, $message_format, $notification );     if ( $result ) {        // The service successfully sent the email; prevent WordPress and other add-ons from also sending the email.        $email['abort_email'] = true;    }     return $email;}
Send the Email
Now we know that no other add-ons have already aborted the email and that this service was selected for the notification the email can be processed and passed to the service for delivery.
123456789101112131415/** * Send the email via the new service. * * @param array $email The email properties. * @param string $message_format The message format, html, or text. * @param array $notification The Notification object which produced the current email. * * @return bool */public function send_email( $email, $message_format, $notification ) {     // pass the email to the service     return $result;}
Further Reading
Depending on the service you may also want to add custom settings to the notification configuration page. You can do that using the following hooks:

gform_notification_ui_settings
gform_pre_notification_save
gform_notification_validation

Any settings added by these hooks would be available in the $notification passed to maybe_send_email() and send_email().

Multi-Page Forms CSS Selectors

Multi-Page Forms CSS Selectors

Progress BarContainerProgress Bar TitleProgress BarPercentage BarPercentage Completed NumberStepsContainerAll StepsActive StepInactive StepPageFooterButtonsNext ButtonPrevious ButtonSubmit Button

Progress Bar
Container

example: multi-page form progress bar container (div) – applies to all forms
body .gform_wrapper .gf_progressbar_wrapper {border: 1px solid red}

example: multi-page form progress bar container (div) – applies just to form ID #1
body #gform_wrapper_1 .gf_progressbar_wrapper {border: 1px solid red}

Progress Bar Title
The progress bar title contains the 「Step x of y」 text.

example: multi-page form progress bar title (h3) – applies to all forms
body .gform_wrapper .gf_progressbar_wrapper .gf_progressbar_title {color: red}

example: multi-page form progress bar title (h3) – applies just to form ID #1
body #gform_wrapper_1 .gf_progressbar_wrapper .gf_progressbar_title {color: red}

Progress Bar
This is the percentage progress bar shown below the above title.

example: multi-page form progress bar (div) – applies to all forms
body .gform_wrapper .gf_progressbar_wrapper .gf_progressbar {border: 1px solid red}

example: multi-page form progress bar (div) – applies just to form ID #1
body #gform_wrapper_1 .gf_progressbar_wrapper .gf_progressbar {border: 1px solid red}

Percentage Bar

example: multi-page form progress bar – percentage bar – applies to all forms
body .gform_wrapper .gf_progressbar_wrapper .gf_progressbar .gf_progressbar_percentage {border: 1px solid red}

example: multi-page form progress bar – percentage bar – applies just to form ID #1
body #gform_wrapper_1 .gf_progressbar_wrapper .gf_progressbar .gf_progressbar_percentage {border: 1px solid red}

Percentage Completed Number

example: multi-page form progress bar – percentage completed number (span) – applies to all forms
body .gform_wrapper .gf_progressbar_wrapper .gf_progressbar .gf_progressbar_percentage span {border: 1px solid red}

example: multi-page form progress bar – percentage completed number (span) – applies just to form ID #1
body #gform_wrapper_1 .gf_progressbar_wrapper .gf_progressbar .gf_progressbar_percentage span {border: 1px solid red}

Steps
Container
Contains the user-defined steps text

example: multi-page form steps container (div) – applies to all forms
body .gform_wrapper .gf_page_steps {border: 1px solid red}

example: multi-page form steps container (div) – applies just to form ID #1
body #gform_wrapper_1 .gf_page_steps {border: 1px solid red}

All Steps

example: multi-page form step (div) – applies to all forms
body .gform_wrapper .gf_page_steps .gf_step {color: red}

example: multi-page form step (div) – applies just to form ID #1
body #gform_wrapper_1 .gf_page_steps .gf_step {color: red}

Active Step

example: multi-page form active step (div) – applies to all forms
body .gform_wrapper .gf_page_steps .gf_step_active {color: red}

example: multi-page form active step (div) – applies just to form ID #1
body #gform_wrapper_1 .gf_page_steps .gf_step_active {color: red}

Inactive Step

example: multi-page form inactive step (div) – applies to all forms
body .gform_wrapper .gf_page_steps .gf_step_pending {color: red}

example: multi-page form inactive step (div) – applies just to form ID #1
body #gform_wrapper_1 .gf_page_steps .gf_step_pending {color: red}

Page
Wraps each 「paged」 set of fields

example: multi-page form page (div) – applies to all forms
body .gform_wrapper .gform_page {border: 1px solid red}

example: multi-page form page (div) – applies just to form ID #1
body #gform_wrapper_1 .gform_page {border: 1px solid red}

example: multi-page form page (div) – applies just to page 2 in form ID #1
body #gform_wrapper_1 #gform_page_1_2 {border: 1px solid red}

Footer
Contains previous and next paging buttons

example: multi-page form footer (div) – applies to all forms
body .gform_wrapper .gform_body .gform_page_footer {border: 1px solid red}

example: multi-page form footer (div) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_page_footer {border: 1px solid red}

Buttons
Next Button

example: multi-page form – next button (input) – applies to all forms
body .gform_wrapper .gform_body .gform_page_footer .gform_next_button {border: 1px solid red}

example: multi-page form – next button (input) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_page_footer .gform_next_button {border: 1px solid red}

example: multi-page form – next button (input) – applies just to button with ID #1 in form ID #1
body #gform_wrapper_1 .gform_body .gform_page_footer #gform_next_button_1_1 {border: 1px solid red}

Previous Button

example: multi-page form – previous button (input) – applies to all forms
body .gform_wrapper .gform_body .gform_page_footer .gform_previous_button {border: 1px solid red}

example: multi-page form – previous button (input) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_page_footer .gform_previous_button {border: 1px solid red}

example: multi-page form – next button (input) – applies just to button with ID #2 in form ID #1
body #gform_wrapper_1 .gform_body .gform_page_footer #gform_previous_button_1_2 {border: 1px solid red}

Submit Button

example: multi-page form – submit button (input) – applies to all forms
body .gform_wrapper .gform_body .gform_page_footer .gform_button {border: 1px solid red}

example: multi-page form – submit button (input) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_page_footer .gform_button {border: 1px solid red}

How To Manually Update For Older WordPress Editions

How To Manually Update For Older WordPress Editions

To manually update Gravity Forms on WordPress versions 5.4 or older, follow the step below.

For more recent WordPress versions, refer to our master article here.

If you haven』t already done so, download the Gravity Forms or Add-On zip from the downloads page. Be sure to save this zip file somewhere easily accessible as you will need it soon.From within your WordPress admin dashboard, click Plugins on the left side navigation menu.If the plugin is active, select the Deactivate option for the plugin you』re trying to update.Select the Delete option for the plugin you』re trying to update.Click OK or Yes when prompted to delete the files. This step deletes the plugin』s folder and the files inside. The data part of the message in the prompt does NOT apply to Gravity Forms or our official add-ons. As mentioned above your data will remain.Click the Add New button.Click the Upload Plugin button.Click the Browse button.Navigate to the zip file you previously downloaded and select it.Once the file is selected, click the Install Now button.Click the Activate Plugin button.

Notification (deprecated)

Notification (deprecated)

IntroductionUsageProperties

Introduction
The Notification object contains the settings for the administrator』s notification, such as destination email address, email subject and body. It is defined as an associative array. For more details on managing your notifications, see the Notifications page.

This article relates to the Notification object used in Gravity Forms 1.6 and earlier. The Notifications Object was introduced in Gravity Forms 1.7.

Usage
$form["notification"]["bcc"]; //returns the BCC email address
$form["notification"]["subject"]; //returns the email subject

Properties

to string
Contains the notification destination email address(es). For multiple emails, separate them with a comma (,) (i.e. [email protected], [email protected]).

from string
If specified, forces the email to be sent from this address. If not specified, the email address configured in WordPress will be used.

fromField string
Id of an email field on the form whose value should be used as the from address.

replyTo string
Contains the email address to be used as the reply to email address.

replyToField string
Id of an email field on the form whose value should be used as the reply to email address.

bcc string
Contains the email address to be used as the bcc email address.

subject string
Contains the subject of the email.

message string
Contains the body/content of the email.

disableAutoformat boolean
Determines if the email message should be formatted so that paragraphs are automatically added for new lines. 1 disables auto-formatting, 0 enables auto-formatting.

routing array
Allows notifications to be routed to different email addresses based on field values entered on the form. This array contains multiple routing rules. Each rule is evaluated separately and the notification will be sent to all rules that match.
$form["notification"]["routing"][0]["email"]; //returns the email of the first routing rule

Following are the properties or each routing rule

fieldId integer
Target field Id. Field that will have it』s value compared with the value property to determine if this rule is a match

operator string
Operator to be used when evaluating this rule.
Possible values: is, isnot

is: Evaluates this rule to true when the value property is equal to the value of field specified by fieldId.
isnot: Evaluates this rule to true when the value property is not equal to the value of field specified by fieldId.

value string
The value to compare with the field specified by fieldId

Multi Select Field CSS Selectors

Multi Select Field CSS Selectors

ContainerFieldItems

Container
example: standard multi select container (div) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .ginput_container_multiselect {border: 1px solid red}
example: standard multi select container (div) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_fields .gfield .ginput_container_multiselect {border: 1px solid red}
example: standard multi select container (div) – applies just to specific multi select inputs (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper .gform_body .gform_fields #field_XX_X.gfield .ginput_container_multiselect {border: 1px solid red}
Field

If you』ve enabled the Enhanced UI option, you will need to target 「chosen-container」 rather than 「select」 in the selectors below.
example: standard multi select field (select) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .ginput_container_multiselect select {border: 1px solid red}
example: standard multi select field (select) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_fields .gfield .ginput_container_multiselect select {border: 1px solid red}
example: standard multi select field (select) – applies just to specific multi select inputs (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper .gform_body .gform_fields #field_XX_X.gfield .ginput_container_multiselect select {border: 1px solid red}
Items
example: standard multi select item (option) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .ginput_container_multiselect select option {border: 1px solid red}
example: standard multi select item (option) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_fields .gfield .ginput_container_multiselect select option {border: 1px solid red}
example: standard multi select item (option) – applies just to specific multi select inputs (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper .gform_body .gform_fields #field_XX_X.gfield .ginput_container_multiselect select option {border: 1px solid red}

Accessing Mapped Field Values During Feed Processing

Accessing Mapped Field Values During Feed Processing

Introductionget_mapped_field_value()ParametersReturnsUsesUsage Exampleget_field_value()ParametersReturnsUsesHooksUsage Examplemaybe_override_field_value()ParametersReturnsHooksUsage Exampleget_full_address()ParametersReturnsget_full_name()ParametersReturnsget_list_field_value()ParametersReturnsget_{$input_type}_field_value()

Introduction
The following functions are located in the GFAddon class; they are also available for use by add-ons which extend the GFFeedAddOn or GFPaymentAddOn classes and can be used to retrieve the mapped form field values during feed processing in the process_feed() method.
get_mapped_field_value()
1protected function get_mapped_field_value( $setting_name, $form, $entry, $settings = false ) {}
Source: Inline Documentation

Parameters

$setting_name string
The setting name; the key to the setting value in the Feed Object meta array.

$form Form Object
The form currently being processed.

$entry Entry Object
The entry currently being processed.

$settings array
The Feed Object meta.

Returns
(string) The value of the mapped field.
Uses

includes/addon/class-gf-addon.php: get_field_value()

Usage Example
1$value = $this->get_mapped_field_value( $meta_key, $form, $entry, $feed['meta'] );
get_field_value()
1public function get_field_value( $form, $entry, $field_id ) {}
Source: Inline Documentation

Parameters

$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.

Returns
(string) The value of the specified field.
Uses

includes/addon/class-gf-addon.php: get_full_address()
includes/addon/class-gf-addon.php: get_full_name()
includes/addon/class-gf-addon.php: get_list_field_value()
includes/addon/class-gf-addon.php: maybe_override_field_value()
get_{$input_type}_field_value()

Hooks
This function contains the following hooks:

gform_addon_field_value

Usage Example
1$email = $this->get_field_value( $form, $entry, rgar( $feed['meta'], 'customerInformation_email' ) );
maybe_override_field_value()
1public function maybe_override_field_value( $field_value, $form, $entry, $field_id ) {}
Override this function to prevent the gform_short_slug_field_value filter being used if you need to implement a custom filter, or need to perform custom formatting of some field types.
Source: Inline Documentation

Parameters

$field_value string
The value to be overridden.

$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.

Returns
(string) The field value.
Hooks
This function contains the following hooks:

gform_short_slug_field_value

Usage Example
12$coupon_field_id = rgar( $feed['meta'], 'customerInformation_coupon' );$coupon          = $this->maybe_override_field_value( rgar( $entry, $coupon_field_id ), $form, $entry, $coupon_field_id );
get_full_address()
1protected function get_full_address( $entry, $field_id ) {}
Override this function if your add-on needs to reformat the Address field value.
Source: Inline Documentation

Parameters

$entry Entry Object
The Entry currently being processed.

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

Returns
(string) Returns the combined value of the specified Address field.
get_full_name()
1protected function get_full_name( $entry, $field_id ) {}
Override this function if your add-on needs to reformat the Name field value.
Source: Inline Documentation

Parameters

$entry Entry Object
The Entry currently being processed.

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

Returns
(string) Returns the combined value of the specified Name field.
get_list_field_value()
1protected function get_list_field_value( $entry, $field_id, $field ) {}
Override this function if your add-on needs to reformat the List field value.
Source: Inline Documentation

Parameters

$entry Entry Object
The Entry currently being processed.

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

$field Field Object
The Field currently being processed.

Returns
(string) Returns the formatted value of the specified List field or List field column.
get_{$input_type}_field_value()
To perform custom formatting of values for a specific field or input type you can define a custom function to be used when the get_field_value() processes that field type. Just replace {$input_type} in the function name with the field type you want to format e.g.
12345678public function get_phone_field_value( $entry, $field_id, $field ) {    $field_value = rgar( $entry, $field_id );    if ( ! empty( $field_value ) && $field->phoneFormat == 'standard' && preg_match( '/^D?(d{3})D?D?(d{3})D?(d{4})$/', $field_value, $matches ) ) {        $field_value = sprintf( '%s-%s-%s', $matches[1], $matches[2], $matches[3] );    }     return $field_value;}

Sending Notifications on Custom Events when Using the Add-On Framework

Sending Notifications on Custom Events when Using the Add-On Framework

IntroductionRegistering the Add-On EventsTriggering the Sending of the NotificationsGFPaymentAddOnGFFeedAddOnEvents Supported by GFPaymentAddOn

Introduction

Since Gravity Forms 1.9.12, add-ons which extend GFFeedAddOn or GFPaymentAddOn can register custom events for which they will send notifications.
Once the events your add-on supports are registered, the user can then edit their notifications (or create new notifications) and assign them to your new events.
The events drop down only appears on the edit notification page when multiple notification events exist for the form; it will appear between the notification name and send to settings.
Registering the Add-On Events
To register the events for which your add-on will trigger the sending of notifications, override supported_notification_events() with an array containing the event keys and labels.
In this example we are registering a number of events which the Stripe Add-On supports, but only if the form has a Stripe feed.
123456789101112131415public function supported_notification_events( $form ) {    if ( ! $this->has_feed( $form['id'] ) ) {        return false;    }     return array(            'complete_payment'          => esc_html__( 'Payment Completed', 'gravityformsstripe' ),            'refund_payment'            => esc_html__( 'Payment Refunded', 'gravityformsstripe' ),            'fail_payment'              => esc_html__( 'Payment Failed', 'gravityformsstripe' ),            'create_subscription'       => esc_html__( 'Subscription Created', 'gravityformsstripe' ),            'cancel_subscription'       => esc_html__( 'Subscription Canceled', 'gravityformsstripe' ),            'add_subscription_payment'  => esc_html__( 'Subscription Payment Added', 'gravityformsstripe' ),            'fail_subscription_payment' => esc_html__( 'Subscription Payment Failed', 'gravityformsstripe' ),    );}
Triggering the Sending of the Notifications
GFPaymentAddOn
If your add-on extends GFPaymentAddOn and the events are listed under Events supported by GFPaymentAddOn, there』s nothing else to do; the payment framework will handle triggering the notifications when those payment events occur.
If your add-on overrides callback() and specifices a callback parameter in the $action array returned then you would need to trigger the sending of notifications in the function you registered as the callback. You can do that by including the following line in your custom callback:
1$this->post_payment_action( $entry, $action );
GFFeedAddOn
For add-ons which extend GFFeedAddOn you would need to trigger the notifications using the GFAPI::send_notifications method at the appropriate time.
In this example we are triggering notifications for a custom event called feed_processed at the end of the process_feed function.
1234567public function process_feed( $feed, $entry, $form ) {    // feed processing code here     GFAPI::send_notifications( $form, $entry, 'feed_processed' );     return;}
Events Supported by GFPaymentAddOn
GFPaymentAddOn() will automatically trigger the sending of notifications for the following events:

complete_payment
refund_payment
fail_payment
add_pending_payment
void_authorization
create_subscription
cancel_subscription
expire_subscription
add_subscription_payment
fail_subscription_payment

Multi Select

Multi Select

SummaryCommon SettingsGeneral SettingsNotesAppearance SettingsMerge TagsUsageModifiers

Summary

The Multi Select field allows users to select multiple options available in the multi select box. It is available under the Standard Fields section within the form editor.

Multi Select field as displayed in the Field Library

Multi Select field as displayed in the Form Editor.

Important: If your choice labels contain any HTML or special characters such as ampersands, commas, hyphens or brackets of any type, you MUST enable the show values feature and give each choice a simple and unique value which does not contain any special characters. Failure to configure values could cause issues for features such as calculations, conditional logic, dynamic population, and validation.

Common Settings

This field uses only common field settings for the Advanced settings. For a description of each of the common field settings, refer to this article. Below you will find description of specialty settings that are particular to this field.

General Settings

SettingDescriptionChoicesAdd Choices to this field. You can mark each choice as checked by default by using the checkbox that appears to the left of each choice. Add a new choice by clicking the PLUS icon and delete a choice by clicking the DELETE icon.Show ValuesChecking this option will allow you to specify a value for each choice. Choice values are not displayed to the user viewing the form but are accessible to administrators when viewing the entry.Bulk Add / Predefined ChoicesAllows you to select a category and customize the predefined choices or paste your own list to bulk add choices. See note 1.

Notes

1. See this article for more information.

Appearance Settings

SettingDescriptionEnable enhanced user interfaceChecking this option enables enhanced functionality to make this more user-friendly.

Merge Tags

For more information on the use of merge tags, refer to these articles.

Usage

{Field Name:2}

Modifiers

This merge tag does not have any modifiers.

Adding Meta Boxes to the Entry Detail Page Using the Add-On Framework

Adding Meta Boxes to the Entry Detail Page Using the Add-On Framework

IntroductionThe HookThe Hook CallbackThe Meta Box Callback

Introduction
In Gravity Forms 2.0 we switched to using meta boxes for the sidebar panels on the entry detail page allowing the user to decide which meta boxes are displayed and their order. This change also makes it easier for add-ons to add their own custom meta boxes to the page.
In this tutorial we will show how you can add a custom meta box to the entry detail page.
Before reading on you should be familiar with the Add-On Framework.
The Hook
Adding a custom meta box to the entry detail page can be accomplished by using the gform_entry_detail_meta_boxes filter in the init or init_admin function of your add-on.
12345678910/** * Plugin starting point. Handles hooks, loading of language files, and PayPal delayed payment support. */public function init() {     parent::init();     add_filter( 'gform_entry_detail_meta_boxes', array( $this, 'register_meta_box' ), 10, 3 ); }
The Hook Callback
The following example shows the function used with the gform_entry_detail_meta_boxes filter to add the meta box to the entry detail page.
Our feed add-on integrates with a third-party service so it has an initialize_api() function used to include the API files and connect to the service to validate any API credentials. If the credentials are valid and the form has an active feed for this add-on then the meta box will be added.
123456789101112131415161718192021/** * Add the meta box to the entry detail page. * * @param array $meta_boxes The properties for the meta boxes. * @param array $entry The entry currently being viewed/edited. * @param array $form The form object used to process the current entry. * * @return array */public function register_meta_box( $meta_boxes, $entry, $form ) {    // If the form has an active feed belonging to this add-on and the API can be initialized, add the meta box.    if ( $this->get_active_feeds( $form['id'] ) && $this->initialize_api() ) {        $meta_boxes[ $this->_slug ] = array(            'title'    => $this->get_short_title(),            'callback' => array( $this, 'add_details_meta_box' ),            'context'  => 'side',        );    }     return $meta_boxes;}
It』s also possible to use the form fields to determine if the meta box should be added. In this example the Quiz Add-On is checking to see if the form uses quiz type fields.
12345678910111213public function register_meta_box( $meta_boxes, $entry, $form ) {    $fields = GFAPI::get_fields_by_type( $form, array( 'quiz' ) );     if ( ! empty( $fields ) ) {        $meta_boxes['gf_quiz'] = array(            'title'    => esc_html__( 'Quiz Results', 'gravityformsquiz' ),            'callback' => array( $this, 'add_quiz_meta_box' ),            'context'  => 'side',        );    }     return $meta_boxes;}
The Meta Box Callback
This callback function is responsible for adding the actual content to our meta box. You could include anything in the meta box but we would recommend keeping it to the essential details.
In the process_feed() example of the Including and using Entry Meta with the Add-On Framework article we showed how a feed based add-on can store entry meta when processing the feed. In this case it was the contact id returned by the third-party service.
The example below shows how the contact id can be retrieved from the entry and displayed in the meta box. If the entry being displayed doesn』t have a contact id because it wasn』t processed by the add-on during form submission the function will display a button which can be used to initiate feed processing for the current entry by our add-on. When the button is clicked the page will reload, processing the feeds, and then display the contact id.
12345678910111213141516171819202122232425262728293031323334353637383940414243/** * The callback used to echo the content to the meta box. * * @param array $args An array containing the form and entry objects. */public function add_details_meta_box( $args ) {     $form  = $args['form'];    $entry = $args['entry'];     $html   = '';    $action = $this->_slug . '_process_feeds';     // Retrieve the contact id from the current entry, if available.    $contact_id = rgar( $entry, 'simpleaddon_contact_id' );     if ( empty( $contact_id ) && rgpost( 'action' ) == $action ) {        check_admin_referer( 'gforms_save_entry', 'gforms_save_entry' );         // Because the entry doesn't already have a contact id and the 'Process Feeds' button was clicked process the feeds.        $entry = $this->maybe_process_feed( $entry, $form );         // Retrieve the contact id from the updated entry.        $contact_id = rgar( $entry, 'simpleaddon_contact_id' );         $html .= esc_html__( 'Feeds Processed.', 'simplefeedaddon' ) . '

';    }     if ( empty( $contact_id ) ) {         // Add the 'Process Feeds' button.        $html .= sprintf( '', esc_attr__( 'Process Feeds', 'simplefeedaddon' ), $action );     } else {         // Display the contact ID.        $html .= esc_html__( 'Contact ID', 'simplefeedaddon' ) . ': ' . $contact_id;         // You could include a link to the contact profile on the third-party site.    }     echo $html;}