Introduction
The Feed Meta Object for the Hubspot Add-On is an associative array with properties determining 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
| Property | Type | Description |
|---|---|---|
| feed_name | string | A unique name for the feed. |
| feed_type | string | Specifies the type of feed action (e.g., create_contact). |
| _hs_form | string | The name of the HubSpot form associated with the feed. |
| _hs_form_guid | string | The unique identifier (GUID) for the HubSpot form. |
| _hs_customer_hs_lead_status | string | Defines the lead status for the contact. |
| _hs_customer_lifecyclestage | string | Specifies the lifecycle stage for the contact (e.g., lead). |
| contact_owner | string | Determines if the contact owner is assigned automatically or specified. |
| contact_owner_select | string | The selected HubSpot contact owner ID. |
| conditions | string | Specifies conditions to determine if the feed should run. |
| _hs_customer_email | string | Specifies the field ID used to map the contact’s email address. |
| _hs_customer_firstname | string | Specifies the field ID used to map the contact’s first name. |
| _hs_customer_lastname | string | Specifies the field ID used to map the contact’s last name. |
| additional_fields | array | An array of additional fields to map, with keys and values for each field. |
| feed_condition_conditional_logic | boolean | Enables conditional logic to determine if the feed should run. |
| feed_condition_conditional_logic_object | array | Stores the conditional logic rules for the feed. |
| _hs_portal_id | integer | The unique portal ID for the HubSpot account. |
| trial_product | string|null | Specifies the trial product, if applicable. |
| trial_amount | string|null | Specifies the trial amount, if applicable. |
Additional Fields Properties
array(
'key' => '',
'custom_key' => '',
'value' => '',
'custom_value' => '',
);
| Setting | Type | Description |
|---|---|---|
| key | string | The name of the custom field. |
| custom_key | string | Custom key if any. |
| value | string | The ID of the form field or entry meta item contains this custom field’s value. Merge tags supported. |
| custom_value | string | Custom value for the field. |