Sync Salesforce opportunities to Google Sheets

CRMMarketingSalesUtilities

What it does

When an opportunity is created or updated in Salesforce, this automation checks for a project number. It syncs the opportunity details to Google Sheets, inserting a new row or updating an existing one based on the opportunity ID.

Who it's for

Sales operations teams who track Salesforce opportunities in a shared Google Sheet without manual entry.

How teams use this

Keep a live opportunity pipeline sheet

Sync every Salesforce opportunity change to Google Sheets so the team sees the current pipeline without refreshing reports. The sheet becomes the source of truth for deal tracking.

Prevent duplicate rows by opportunity ID

Use the opportunity ID as the unique key so updates never create duplicate rows. Each opportunity appears once and reflects the latest Salesforce state.

Filter only opportunities with a project number

Add a condition to sync only opportunities that have a project number assigned. This keeps the sheet focused on qualified deals and reduces noise.

Include account hierarchy in the sheet

Extend the row to include parent account and account owner from Salesforce so the sheet shows the full customer context. This requires mapping those fields to new columns.

How it works

  1. Opportunity created or updated. A new opportunity is created in Salesforce or an existing one is modified, and this automation retrieves the record to check for a project number.
  2. Retrieve opportunity and account details. Fetch the full opportunity record and its related account information from Salesforce to prepare the data for the sheet.
  3. Search for matching row in sheet. Query Google Sheets for an existing row with the same opportunity ID to determine whether to insert or update.
  4. Insert or update the row. Add a new row to Google Sheets if no match is found, or update the existing row with the latest opportunity details from Salesforce.