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
Property | Type | Description |
---|---|---|
feedName | string | A unique name for the Salesforce feed. |
objectType | string | The Salesforce object type associated with the feed, such as “Contact” or “Lead”. |
feed_condition_conditional_logic_object | array | Stores the conditional logic rules for the feed. Empty if no rules are defined. |
feed_condition_conditional_logic | boolean | Determines whether conditional logic is enabled for the feed. |
fieldMapping_{key} | string | Replace {key} with the name of the object field that is mapped. |
updateDuplicates | boolean | Determines whether duplicate records should be updated in Salesforce. |
feedCondition | string | Specifies additional conditions for running the feed. |