This document outlines a solution for those using Salesforce that enables them to achieve a more efficient and automated workflow with Salesforce data
Airtable provides an API that allows you to create, read, update, and delete records in a given base. Using this API, we’ve seen organizations create sophisticated data pipelines between Airtable and other services, such as Salesforce. Many teams choose Salesforce to be their CRM, but we often see these same teams struggle to create day-to-day operational workflows on top of the data that they are pouring into Salesforce. These teams need a way to collaboratively share information, create ad-hoc notes and reports, all in a way that decreases their operational overhead.
There are many possible solutions to the integration with Salesforce, but this article will go over one common method.
How to use Salesforce with Airtable
Integrating Salesforce with Airtable allows you to pull a subset of data out of Salesforce such that you can then construct these end-to-end workflows in a way that’s optimal for your team’s day-to-day management.
This guide focuses on pulling information from Salesforce, not writing data back to it. There are ways to extend the examples provided here to then push data and changes from Airtable back into your Salesforce ecosystem.
What you will need
Salesforce Integration Step by Step
There are a few sections to setting up your Salesforce instance. First, we need to create the base where we want our data to live. Then we need to gather the necessary API tokens from both Airtable and Salesforce to create the integration. Finally, we can then download the code, set up our configuration and execute the data transfer.
Setting It Up
1. Create your Airtable base where you want to load your Salesforce data
- We recommend starting with this template: Sales CRM
- Generally, each object you want to push from Salesforce should be its own table in your base
2. On each table, create the fields for the data you want to capture
3. Each table must have a field for storing the underlying Salesforce Object ID
- It must be the primary field for each table
- This allows us to make updates to the same object without creating duplicates and is helpful if you want to move data back into Salesforce
- We generally refer to this field as “SFDC ID”
Authentication & Setting up Environment
1. In Airtable, follow these directions to generate your API key
2. In Airtable, we will need the base ID for the base you want to move data in to
- This can be found by loading the base, clicking on Help and then API Documentation. In the first section of the page, you’ll see something that says: The ID of this base is appXXXXXXXX.
- appXXXXXXXX is your base ID
3. In Salesforce, follow these directions to generate your security token
4. In your development environment, set the following environment variables:
- AIRTABLE_API_KEY: your Airtable API Key
- SALESFORCE_EMAIL: the email you use to login to Salesforce
- SALESFORCE_PW: your Salesforce password
- SALESFORCE_SECURITY_TOKEN: the security token you generated
Downloading and Executing Code
1. Download the Salesforce to Airtable integration example at: https://github.com/TheF1rstPancake/salesforce_to_airtable
2. In the directory, run npm install
3. We can then make changes to the config.js file to be specific to your environment
- base_id: the ID of your base
- sfdc_to_at: the mapping of Salesforce objects to Airtable tables
- Each key is the name of a Salesforce object
- The value is an object which defines how fields in Salesforce map to your Airtable tables
- See the documentation in config.js for more details
4. Execute using “npm run”. This will begin to pull data out of Salesforce and push it into Airtable
You can use a tool like Postman or cURL, to test your API endpoints and Authentication parameters to make sure you are getting data from the two systems.
There are many different ways to go about integrating Salesforce and Airtable! Would love to see how you and your team approach this integration and what specifically you’re trying to leverage Airtable for.
Feel free to post at our Community Page about your integration.