Hubspot Feed Meta

Introduction

The Feed Object meta for the Hubspot Add-on is an associative array containing the properties which determine how the add-on should process the form submission.

$feed['meta'] = array(
    'feed_name' => 'HubSpot Feed 1',
    'feed_type' => 'create_contact',
    '_hs_form' => 'Gravity Forms - Hubs',
    '_hs_form_guid' => '5525a480-ba5e-4d8a-83df-03b158b304af',
    '_hs_customer_hs_lead_status' => 'OPEN',
    '_hs_customer_lifecyclestage' => 'lead',
    'contact_owner' => 'none',
    'contact_owner_select' => '44862745',
    'conditions' => '',
    '_hs_customer_email' => '',
    '_hs_customer_firstname' => '',
    '_hs_customer_lastname' => '',
    'additional_fields' => array(
        array(
            'key' => '_hs_customer_city',
            'custom_key' => '',
            'value' => '',
            'custom_value' => '',
        ),
    ),
    'feed_condition_conditional_logic_object' => array(),
    'feed_condition_conditional_logic' => '0',
    'conditionalLogic' => '',
    '_hs_portal_id' => 7260976,
    'trial_product' => NULL,
    'trial_amount' => NULL,
);

Usage

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

$conditional_logic_enabled = rgars( $feed, 'meta/feedCondition' );

if ( $conditional_logic_enabled ) {
    // Conditional logic is enabled for this feed.
    $logic_rules = rgars( $feed, 'meta/feed_condition_conditional_logic_object/conditionalLogic/rules' );
    foreach ( $logic_rules as $rule ) {
        // Process each conditional logic rule.
        $field_id  = rgar( $rule, 'fieldId' );
        $operator  = rgar( $rule, 'operator' );
        $value     = rgar( $rule, 'value' );
        // Example: Use $field_id, $operator, and $value in your logic.
    }
}

Properties

PropertyTypeDescription
feed_namestringA unique name for the feed.
feed_typestringSpecifies the type of feed action (e.g., create_contact).
_hs_formstringThe name of the HubSpot form associated with the feed.
_hs_form_guidstringThe unique identifier (GUID) for the HubSpot form.
_hs_customer_hs_lead_statusstringDefines the lead status for the contact.
_hs_customer_lifecyclestagestringSpecifies the lifecycle stage for the contact (e.g., lead).
contact_ownerstringDetermines if the contact owner is assigned automatically or specified.
contact_owner_selectstringThe selected HubSpot contact owner ID.
conditionsstringSpecifies conditions to determine if the feed should run.
_hs_customer_emailstringSpecifies the field ID used to map the contact’s email address.
_hs_customer_firstnamestringSpecifies the field ID used to map the contact’s first name.
_hs_customer_lastnamestringSpecifies the field ID used to map the contact’s last name.
additional_fieldsarrayAn array of additional fields to map, with keys and values for each field.
feed_condition_conditional_logicbooleanEnables conditional logic to determine if the feed should run.
feed_condition_conditional_logic_objectarrayStores the conditional logic rules for the feed.
_hs_portal_idintegerThe unique portal ID for the HubSpot account.
trial_productstring|nullSpecifies the trial product, if applicable.
trial_amountstring|nullSpecifies the trial amount, if applicable.

Additional Fields Properties

array(
    'key'          => '',
    'custom_key'   => '',
    'value'        => '',
    'custom_value' => '',
);
SettingTypeDescription
keystringThe name of the custom field.
custom_keystringCustom key if any.
valuestringThe ID of the form field or entry meta item contains this custom field’s value. Merge tags supported.
custom_valuestringCustom value for the field.