Salesforce
Google Sheets + Salesforce Integration
Query from Salesforce into Google Sheets or Post data from Google Sheets into Salesforce
What is Sheet Director?
Sheet Director is a Google Workspace add-on that helps to manage and control bi-directional data flow between Google Sheets and several other applications like Google Calendar, Tasks, Contacts, Sheets, QuickBooks, FreshBooks, Zoho, Zendesk, etc.
It is available in the Google Workspace Marketplace. Please check the Installation instructions to install the add-on.
What is Salesforce?
Salesforce Sales Cloud – The Sales Cloud is a CRM platform that enables you to manage your organization's sales, marketing and customer support facets. ... You can use this platform to exchange data and images in real time.
Salesforce to Google Sheets: Use Case(s)
> Pull contacts from Salesforce objects and store it into a spreadsheet - Query
> Push contacts from spreadsheet to Salesforce - Post
Salesforce
Sheet Director
Google Sheets
Demo Video: How to integrate Google Sheets & Salesforce?
Setting up Salesforce in Sheet Director
Choose App and Service:
Mention the required service name.
Select Salesforce from the list of applications.
Select service as Query.
Click on Connect to Salesforce to authenticate to Salesforce.
Click Allow to allow Salesforce to grant access to Sheet Director.
Salesforce to Google Sheet - Query
Setup
If Salesforce is connected successfully the following screen appears.
Select the required entity
Select the Filters as required.
Filters include fields, matches, value.
Select the maximum result that is required.
Destination Settings:
Configure the destination settings to save the executed data.
Scheduler Settings:
Switch on Run automatically to execute services automatically in background.
Notification Settings:
Configure the Notification settings to setup the email templates and add attachments.
Click Execute to execute the services.
Click Save to save the services.
Sample Output
Google Sheet to Salesforce - Post
Entity
Select the entity object that you need to post to
Select Apply Template or Setup Mapping
Select Apply Template to add a default template.
Select Setup Manually to select manually.
Source Sheet
Choose the sheet that contains post records.
Enter the Start at cell value
(the default value is A1, if you change the value you need to refresh the header by clicking on refresh icon on side)
Select the Status column
If status column is not there, simply click the +button to add the status header on your sheet(A status column will be created in Spreadsheet)
Select the Result column
If result column is not there, simply click the +button to add the result header on your sheet(A result column will be created in Spreadsheet)
Mapping
After selecting the entity it will ask for intelligent mapping
If you need to do intelligent mapping click on yes
Intelligent mapping will map the matching fields automatically
You can do manual mapping by selecting Column drop down
You can delete the field by click on delete icon on top of each filed map
You can't delete mandatory* fields
Click on execute will ask for confirmation
Click save to save the service
It will show number of records ready to post
Click post now to post the records on Salesforce
Sample Output
It will show the count of number of records posted successfully and failed to post.
Google Sheet to Salesforce - Sync
Select service as Synchronize Salesforce.
Select the Max results required.
Synchronize settings:
Synchronization Keys:
The keys will be used for matching rows in Google Sheets with data in Salesforce.
Conflict Resolution:
When Synchronization happens, there could be a conflict of data between Google Sheets and Salesforce.
Salesforce Wins
Google Sheet Wins
Salesforce Wins: Latest data from Salesforce will be updated in Google Sheets.
Google Sheet Wins: Latest data from Google Sheets will be updated in Salesforce.
Note: The major requirement in synchronization is the synchronize keys. If any of the keys is not having a value in the Google Sheet then Sheet Director will create it first and then the service will be executed.
Salesforce Wins
Select Salesforce.
The latest updated data from Salesforce will be updated in Google Sheets.
Choose the spreadsheet to store data.
Select the required cell value.
Select the Status column
If the status column is not there, simply click the +button to add the status header on your sheet(A status column will be created in the Spreadsheet)
Select the Result column
If the result column is not there, simply click the +button to add the result header on your sheet(A result column will be created in the Spreadsheet)
Click Execute to execute the data.
The number of records that are ready to be synchronized will be shown.
It will also show all the data that are ready to be updated.
Also, the number of data that needs to be updated into Salesforce will also be updated.
Click on Sync Now to sync all the data and update it into Google Sheets.
Click on the Refresh icon to refresh the data.
If the data are synced successfully the following screen appears.
Click on Close to close the configuration.
Sample Output
The Status column in the Google Sheets shows the status of the data.
The newly updated data will be marked as Synced Successfully.
The old data that already exists will be marked as Already Synchronized.
Google Sheet Wins
Select Google Sheet Wins.
The latest updated data from Google Sheet will be updated into Salesforce.
Select the sheet to store the output.
Select the Status column
If the status column is not there, simply click the +button to add the status header on your sheet(A status column will be created in the Spreadsheet)
Select the Result column
If the result column is not there, simply click the +button to add the result header on your sheet(A result column will be created in the Spreadsheet)
Click Execute to execute the data.
Click Save to save.
The number of records that are ready to be synchronized will be shown.
It will also show all the data that are ready to be updated.
Also, the number of data that needs to be updated into Salesforce will also be updated.
Click on Sync Now to sync all the data and update it into Google Sheets.
Click on the Refresh icon to refresh the data.
If the data are synced successfully the following screen appears.
Click on Close to close the configuration.
Sample Output
The Status column in the Google Sheets shows the status of the data.
The newly updated data will be marked as Synced Successfully.
The old data that already exists will be marked as Already Synchronized.
Frequently Asked Questions
What does the "invalid_grant" error with an expired access/refresh token indicate?
The "invalid_grant" error typically occurs when there are issues with the authentication process in Salesforce, specifically related to expired access or refresh tokens.
What are the common causes of the "invalid_grant" error, and how can it be fixed?
There are a few common causes for the "invalid_grant" error with an expired access/refresh token
Temporary Solution: Disconnecting and connecting again will seem to resolve the issue for certain period
Exceeding Access Grants Limit:
Salesforce limits the number of access grants for a Connected App to 5 per user. If a user exceeds this limit, the oldest approval will be automatically revoked. For more information, check out this article: Manage OAuth-Enabled Connected Apps Access to Your Data - Salesforce.
Immediately Expire Refresh Token" Enabled:
Solution: Ensure that the "Refresh token is valid until revoked" option is selected. You can find this setting in your Salesforce account under Settings → Apps → Connected Apps → Manage Connected Apps → {{ Sheet Director or App Name }} → Edit Policies.
Make sure the Refresh token is valid until revoked is selected.