Skip to main content

Salesforce integration

CommandBar’s integration with Salesforce works in two directions:

  1. CommandBar —> Salesforce: send CommandBar-generated events to Salesforce
  2. Salesforce —> CommandBar: use attributes that exist in Salesforce for Who targeting in CommandBar

Sending CommandBar events to Salesforce

This is a 1-step integration!

Navigate to Integrations and click “Enable” on the Salesforce integration card.

Using Salesforce data and events in CommandBar

Sending Properties to CommandBar

You can send any of the existing user properties that you send to Salesforce to CommandBar Here’s a simplified code snippet:

// Your existing user properties
var userProperties = {
Id: "0017000000hOMChAAO",
Name: "Updated Lead Name",
...
};

// Single record update example for an Account
conn.sobject("Lead").update(userProperties, function(err, ret) {
if (err || !ret.success) { return console.error(err, ret); }
console.log('Updated Successfully : ' + ret.id);
// ...
});

// And additionally sent to CommandBar:
window.CommandBar.addMetadataBatch(userProperties);

// Adding one-off or session only properties to CommandBar is easy too:
window.CommandBar.addMetadata("userIsWorkspaceOwner", true);