Salesforce Feed Meta

Introduction

The Feed Meta Object for the Salesforce Add-On is an associative array with properties determining how the add-on should process the form submission.

$feed['meta'] = array(
    'feedName' => 'Salesforce Feed 1',
    'objectType' => 'Contact',
    'feed_condition_conditional_logic_object' => array(),
    'feed_condition_conditional_logic' => '0',
    'fieldMapping_{key}' => '',
    'updateDuplicates' => '',
    'feedCondition' => '',
);

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
feedNamestringA unique name for the Salesforce feed.
objectTypestringThe Salesforce object type associated with the feed, such as “Contact” or “Lead”.
feed_condition_conditional_logic_objectarrayStores the conditional logic rules for the feed. Empty if no rules are defined.
feed_condition_conditional_logicbooleanDetermines whether conditional logic is enabled for the feed.
fieldMapping_{key}stringReplace {key} with the name of the object field that is mapped.
updateDuplicatesbooleanDetermines whether duplicate records should be updated in Salesforce.
feedConditionstringSpecifies additional conditions for running the feed.