Can Gravity Forms Do…?

Can Gravity Forms Do…?

A very common question we see is 「can Gravity Forms do X?」
Gravity Forms is a very flexible and powerful WordPress plugin. We keep a basic feature list here, and our library of help documents and user guides provides many more details. Additionally, our Customer Support Team are always available to try and help you get you an answer regarding product capabilities.
For other features, check out our Add-ons, which provide many ways to extend Gravity Forms or to interact with other popular services.
Additionally, we provide a robust development API, so don』t forget to search our third party add-on library or other common repositories for add-ons developed by third parties to work with Gravity Forms. Someone else may very well have already developed what it is you are thinking of!
If the feature you want isn』t covered by our core software or any available add-ons, but you have some software skills yourself, then maybe you can develop it yourself. Consult our developer documentation.
Still want a new feature or integration, but can』t develop it yourself? Consider hiring an developer (we do not provide custom development services). See this article for a few starting options.

Forcing Gravity Forms Database Upgrades

Forcing Gravity Forms Database Upgrades

If you』re having issues upgrading the Gravity Forms database after an update, this can sometimes be due to a failed database modification. Often times, forcing the database upgrade can resolve the issue. Attempting to do a manual upgrade is not recommended and this method should be followed. Here』s how to force a Gravity Forms database upgrade.

Before making any changes, it』s always a good idea to backup your database. If you』re not sure how to do so, contact your web hosting provider.Within your WordPress admin dashboard, hover over Forms and click on System Status.Scroll down to the Database section and click on Re-run database upgrade.

Your database upgrade should now be complete.

If you are getting repeated upgrade issues, contact our support team for expert technical advice.

The System Status page, showing the database upgrade option.

Entry Object

Entry Object

IntroductionUsagePropertiesStandardPricing PropertiesPost CreationField ValuesList FieldCheckboxes FieldAdd-On Field ValuesEntry JSON

Introduction
The Entry object contains all properties of a particular entry (i.e. date created, client IP, submitted field values, etc…). It is formatted as an associative array with field Ids being the key to that field』s data.
Usage
rgar( $entry, 'date_created' ); // returns the entry date
rgar( $entry, '1' ); // returns the value associated with field 1 (This would be for fields with single input like Text, Number, Drop Down, etc...)
rgar( $entry, '1.3' ); // returns the value associated with the first name portion of a simple name field 1
rgar( $entry, '1.6' ); // returns the value associated with the last name portion of a simple name field 1
rgar( $entry, '2.4' ); // returns the value associated with the state input for the address field 2
rgar( $entry, '5.1' ); // returns the field label for a single product that has id 5
rgar( $entry, '5.1' ); // returns the field label for a single product that has id 5
GFCommon::to_number( rgar( $entry, '5.2' ) ); // returns the field price, without currency symbol, for a single product that has id 5
rgar( $entry, '5.3' ); // returns the field quantity for a single product that has id 5

Properties

Standard

id integer
The entry』s Id.

form_id string
The ID of the form from which the entry was submitted.

created_by integer
ID of the user that submitted the form if a logged in user submitted the form.

date_created string
The date and time that the entry was created, in the format 「yyyy-mm-dd hh:mi:ss」 (i.e. 2010-07-15 17:26:58)

is_starred bool
Indicates if the entry has been starred (i.e marked with a star). 1 for entries that are starred and 0 for entries that are not starred.

is_read bool
Indicates if the entry has been read. 1 for entries that are read and 0 for entries that have not been read.

ip string
Client IP of user who submitted the form.

source_url string
Source URL of page that contained the form when it was submitted.

post_id integer
For forms with Post fields, this property contains the Id of the Post that was created.

user_agent string
Provides the name and version of both the browser and operating system from which the entry was submitted.

status string
The current status of the entry (ie 「Active」, 「Spam」, 「Trash」).

Pricing Properties
These $entry properties are only relevant when a Gravity Forms payment gateway add-on is being used.

currency string
The currency with which the entry was submitted (ie 「USD」, 「EUR」).

payment_status string
The current payment status of the entry (ie 「Authorized」, 「Paid」, 「Processing」, 「Pending」, 「Active」, 「Expired」, 「Failed」, 「Cancelled」, 「Approved」, 「Reversed」, 「Refunded」, 「Voided」).

payment_date string
The date the payment has been received.

payment_amount integer
The amount of the fulfilled payment; this property is empty until the payment has been received. Sample value: 75

transaction_id string
ID of the transaction returned by the payment gateway

is_fulfilled bool
Indicates if the entry/order has been fulfilled. 1 for entries that have been fulfilled and 0 for entries that have not been fulfilled.

transaction_type integer
Indicates the transaction type of the entry/order. 1 for one time payments, 2 for subscriptions.

Post Creation
The following property is only relevant when the form is used to create a WordPress post.

post_id integer
The id number of the post created as result of the form submission.

Field Values

FIELD_ID string
The value for all submitted fields can be retrieved by using the Field Id as the key to the $entry array.
rgar( $entry, '1' ); // returns the value associated with field 1
rgar( $entry, '2.4' ); // returns the value associated with the state input for the address field 2

List Field
The List field type due to its complex setup compared to other field types (it has many rows and columns of data) it』s stored in serialized format, so you need to unserialize it first to access the data.
maybe_unserialize( rgar( $entry, '3' ) ); // unserialize values associated with list field 3

Checkboxes Field
The easiest way to get the checked checkboxes would be to get a comma separated string containing the selected choices without accessing each input in the entry and building the string yourself would be to use the get_value_export method of the field object, here』s an example
$field_id = 18; // Update this number to your field id number
$field = RGFormsModel::get_field( $form, $field_id );
$value = is_object( $field ) ? $field->get_value_export( $entry ) : '';

That would return a comma separated list containing the values for the selected choices, if you wanted to use the choice text then you would use the following
$value = is_object( $field ) ? $field->get_value_export( $entry, $field_id, true ) : '';

You can then convert that comma separate list to an array, if you want, using PHP』s explode() function.
Add-On Field Values
See the following pages for details about the entry values for fields added by add-ons:

Coupon
Dropbox Upload

Entry JSON
This example shows how an entry array would look when formatted as JSON for use by the Gravity Forms CLI Add-On.
{
"id":"1",
"form_id":"1",
"date_created":"2016-03-22 19:13:19",
"is_starred":0,
"is_read":0,
"ip":"192.168.50.1",
"source_url":"http://local.wordpress.dev/?gf_page=preview&id=1",
"post_id":null,
"currency":"USD",
"payment_status":null,
"payment_date":null,
"transaction_id":null,
"payment_amount":null,
"payment_method":null,
"is_fulfilled":null,
"created_by":"1",
"transaction_type":null,
"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36",
"status":"active",
"1":"Third Choice",
"2":"This is text content"
}

Field Types

Field Types

The following field types are available when creating settings using the Settings API:

Dynamic Field Map
Creates a set of fields that allow the user to map their form fields to custom keys (fields) entered by the user.

Checkbox
Creates a checkbox field.

Checkboxed Select
Creates a complex field where a hidden drop-down field is displayed when the checkbox is checked.

Custom Field
Learn how to create custom field types.

Field Map
Creates a set of fields that allow the user to map their form fields to a custom field selected from a predefined list.

Field Select
Creates a drop down field populated with fields from the form.

Generic Map
Creates a set of fields that allow the user to map custom keys to custom values, based on submission or other data.

Hidden
Creates a hidden field.

Radio Button
Creates a radio button field.

Select
Creates a select/drop-down field.

Save Button
Creates a save button.

Select Custom
Creates a select/drop-down field which also allows users to enter a custom value.

Simple Condition
Creates a complex set of fields allowing users to specify a condition (i.e. Country is Brazil).

Text
Creates a text field.

Textarea
Creates a textarea field.

{entry_id} Merge Tag

{entry_id} Merge Tag

SummaryUsageNotesSee Also

Summary
Displays the entry ID of the submission.
Usage
{entry_id}
Notes
This merge tag can be used in areas such as notifications and confirmations after the entry has been saved. Because of this timing, they cannot be used as a field』s default value.
See Also
The {entry} merge tag.

Fields Available for Forms

Fields Available for Forms

IntroductionStandard FieldsAdvanced FieldsPost FieldsPricing Fields

Introduction

The Form Editor toolbox groups fields under a few categories: Standard, Advanced and Post. This post is a quick reference to all the standard field types available in Gravity Forms. 

Some fields may require a specific Gravity Forms Add-On to be installed in order to function, and that may require a certain Gravity Forms license type. Those fields are marked with an 「AO」 superscript below.

Deleting a field will also delete all entry data associated with that form field.

Standard Fields

Standard Fields are basic form fields that can be customized for just about any use. These can be used to capture and store a variety of data when an advanced field is not available to meet your needs.

Single Line TextParagraph TextDrop DownNumberCheckboxesRadio ButtonsHiddenHTMLSection BreakPage Break

Advanced Fields

Advanced Fields are more advanced form field types with specific usage in mind. Advanced fields may actually contain multiple fields in one container. These fields make it easy to capture data such as a users Name, Address, etc.

NameDateTimePhoneAddressWebsiteUsername AOPassword AOEmailFile UploadCAPTCHAListMulti SelectConsentChained Selects AOQuiz AOSurvey AO

Post Fields

Post Fields are form fields that enable you to capture data that is then used to create a WordPress Post. These fields make it quick and easy for you to create forms that allow users to submit content to your site. The result posts will be set as a Draft and will need to be published before they are visible.

Post TitlePost BodyPost ExcerptPost TagsPost CategoryPost ImagePost Custom Field

Pricing Fields

Pricing Fields are form fields that enable you to create products focussed forms. Additionally, this is where you will find Add-On specific payment collection fields, such as the Stripe Card field, and the (mostly deprectaed) generic credit card field that is still utilized for the Authorize.net Add-On.

ProductOptionQuantityShippingTotal2Checkout card field AOMollie card field AOSquare card field AOStripe card field AOCredit Card

Feed Object

Feed Object

IntroductionUsagePropertiesAdd-on ArticlesGF Feed Add-OnsGF Feed Add-OnsGF Payment Add-Ons

Introduction

The Feed Object ($feed) is an associative array containing all the properties which determine if and how the form submission is processed by an add-on. For example, the feed for a payment add-on determines the type of payment transaction which occurs and what values are sent to the payment gateway.

1234567$feed = array(    'id'         => 5,    'form_id'    => 10,    'is_active'  => true,    'meta'       => array(),    'addon_slug' => 'gravityformsslack',);

Usage

We recommend accessing the $feed properties using the rgar() or rgars() functions e.g.

12$meta = rgar( $feed, 'meta' );$conditional_logic_enabled = rgars( $feed, 'meta/feed_condition_conditional_logic' );

Properties

PropertyTypeDescriptionidintegerThe feed ID.form_idintegerThe form ID this feed was created for. An ID of 0 indicates the feed applies to ALL forms.is_active booleanIs the feed active or inactive. Default is true.feed_orderintegerThe order the feed will be displayed in the feeds list for the form. Also applies to submission time feed processing. Not all add-ons support feed ordering.metaarrayFeed meta is an associative array. The available properties vary from add-on to add-on. Please see the Add-on Articles below for the individual propertiesaddon_slugstringThe slug belonging to the add-on used to create the feed, including the gravityforms prefix. See the Gravity Forms Add-On Slugs article for a list of possible slugs.event_typestringFor future usage.

Add-on Articles

GF Feed Add-Ons

GF Feed Add-Ons

GF Payment Add-Ons

ActiveCampaign Feed MetaAgile CRM Feed MetaAWeber Feed MetaBreeze Feed MetaCampaign Monitor Feed MetaCampfire Feed MetaCapsule CRM Feed MetaCleverReach Feed MetaCoupons Feed MetaDropbox Feed MetaEmma Feed Meta

Freshbooks Feed MetaGetResponse Feed MetaHelp Scout Feed MetaHighrise Feed MetaHipChat Feed MetaiContact Feed MetaMad Mimi Feed MetaMailChimp Feed MetaSlack Feed MetaTrello Feed MetaTwilio Feed MetaUser Registration Feed MetaZapier Feed MetaZoho CRM Feed Meta

Authorize.net Feed MetaPayPal Payments Pro Feed MetaPayPal Standard Feed MetaStripe Feed Meta

Exporting a Form

Exporting a Form

When moving a form from one location to another, or even to backup your data, we have provided a tool within Gravity Forms to perform an export of your created form with just a few clicks. In this article, we will show you how to easily export any forms you have created using Gravity Forms.

First, log into your WordPress admin dashboard.
Once logged in, hover over Forms on the left side navigation menu and click on Import/Export.
Once on this page, you will notice a few different options. Click on the second option labeled Export Forms.
From here, select the checkbox next to any forms that you want to export. Then, click Download Export File.
You will then be prompted to save a JSON file containing all of your form settings. Be sure to save this is a safe place for easy access later.

Your form should now be successfully exported. If you need to import your form, you may review our article on importing forms into Gravity Forms.

{all_fields} Merge Tag

{all_fields} Merge Tag

SummaryUsageModifiers:admin:value:empty:noadmin:nohidden

Summary
Displays a preformatted HTML table containing all of the submitted values.
Usage
{all_fields}
{all_fields:[modifier1],[modifier2],[…]}
Modifiers
You may append multiple modifiers using comma as a delimiter. They are not order sensitive.
Examples:
{all_fields:value,empty}
{all_fields:admin,value}
:admin
Uses the fields』 Admin Labels (if specified) rather than the default field labels.
Example: {all_fields:admin}
:value
Displays the actual value rather than the corresponding value label. This typically applies to fields with multiple inputs such as checkboxes, radio buttons and drop downs.
Example: {all_fields:value}
:empty
Shows fields for which no value was submitted.
:noadmin
Hides field output of fields set to a Visibility of Admin Only.
:nohidden
Hides field output of fields using the Hidden field type. It doesn』t affect to fields set to a Visibility of Hidden.