GuidesRecipesAPI ReferenceChangelog
HomeSee demo
Guides

Salesforce

Source and destination

Polytomic connects to Salesforce using OAuth and requires a Salesforce account with read-write permissions. While not required, we recommend you create a user in Salesforce exclusively for Polytomic so that the audit logs in Salesforce distinguish all Polytomic activity.

📘

Salesforce sandbox

Connecting Polytomic to a Salesforce sandbox is no different than connecting to a production instance; the same instructions apply. Indeed, if you have a Salesforce sandbox available we recommend you create two Salesforce connections in Polytomic: one to your sandbox for testing and one to your production instance.

Creating a connection

  1. In Polytomic, go to ConnectionsAdd ConnectionSalesforce.

  2. Pick your connection name and enter your unique Salesforce domain or ID. The domain is often a string in the format foocorp.my.salesforce.com. You can also enter your unique ID instead, foocorp in this case.

  1. Click Connect to Salesforce and go through OAuth authentication using a Salesforce account. Successful authentication will result in the connecting username being shown:

  1. Click Save.

Connection maintenance

  • Polytomic automatically enforces a conservative daily Salesforce API-call limit on itself derived from your Salesforce instance. You can override Polytomic's automatic behavior with a specific daily API-call limit of your choice by ticking the Enforce API limits box.
  • If you need to change the authorized user, you can click the Force reconnect button and re-authenticate the connection with the new user.
1140

Syncing from Salesforce

Formula fields

When it comes to Salesforce formula and rollup fields, many vendors skip syncing them or write them into intermediate representations in your data warehouse, in which case you need to do the work to parse and combine them with the rest of your data to see their true values.

Polytomic represents Salesforce formula and rollup fields as any other field, thus avoiding causing inconvenience for the data consumer.

When syncing from Salesforce to your other systems (data warehouses included), Polytomic materialises formula fields in the destination system as standard fields/columns, just like any other Salesforce field.

This applies to all formula fields, whether numeric, currency, date, text, or other. There is no special processing required on your part to digest the formula field values synced by Polytomic.

To do this, Polytomic syncs a bit more data beyond just checking Salesforce's last_modified timestamps (as those don't update with formula and rollup field updates).

At enterprise scale, your data may be too large to wait for this sync every time. In that case, you can specify a multi-schedule frequency for your Salesforce bulk sync into your data warehouse, by picking the Per field type schedule option:

This will set up two separate schedule:

  • Purely incremental updates based on last_modified fields and their analogues. These updates will not propagate updates to formula and rollup fields, but they will be fast. Fields that do not update on the incremental schedule are marked with a tortoise icon (as shown in the screenshot below).
  • Non-incremental updates which will update the whole lot, including formula and rollup fields. In this scenario you can think of this as a catch-up sync to the latest formula and rollup field values.

Tooling API objects

Polytomic supports syncing from the metadata objects behind Salesforce's Tooling API (e.g. Entity Particles and others). To surface those in your Salesforce connection, make sure to tick the Enable support for Tooling API box in your Salesforce connection:

Surfacing these objects will consume a few extra Salesforce API calls.

History cutoff

When syncing objects from a large Salesforce instance, you may want to avoid syncing all history. You can set a history cutoff date in Polytomic which will restrict the sync to only those Salesforce records that were last updated after your chosen cutoff date:

While Polytomic offers a global date cutoff, you can also override this on a per-object basis:

And, of course, if you'd like even finer per-object filters to apply before your Salesforce data starts syncing, you can also use Polytomic's bulk sync table filters.

Syncing to Salesforce

Substring-match identity mapping

By default, Polytomic will use exact equality as the matching function in your identity mapping. But there are situations where you may want a substring match. For example, if your source identity values are domains (e.g. acme.com) while your Salesforce target identity values are URLs (e.g. https://www.acme.com). This is a case where you may want a match despite the text on the two sides being different.

After you specify your identity mapping, you can enable substring identity matching by clicking on Equals and choosing Substring of instead, as shown in these screenshots:

Delete mode

When syncing to Salesforce, one of the sync modes supported by Polytomic is Delete mode:

This deletes designated records in Salesforce. Specifying what should be deleted is like with any other sync: pick your identity mapping from your source and set any filter conditions (other field mappings are unnecessary in this mode):

In the example above, Polytomic will delete all Contacts in Salesforce that meet these two conditions:

  • The Salesforce Email field value matches that of the Email field of the source model.
  • The source model's Is deleted field for the matching record is set to true.

Syncing from Salesforce

When syncing from Salesforce to your data warehouse using bulk syncs, you have the option of a multi-schedule sync. This is a sync that runs on two schedules: one for incremental updates, and one for full syncs. The latter is necessary to catch up to the latest values for formula fields and rollup fields whose updates don't show up in incremental runs due to limitations in Salesforce.

You can set a multi-schedule sync by selecting the Per field type schedule option: