bookmark_borderEntry Object

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

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 of 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 “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.

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: