# Google Sheets Salesforce Pipeline Export

> Pull your Salesforce pipeline into Google Sheets for reporting, team reviews, and executive visibility without manual copy-paste.

Source: https://cotera.co/solutions/ops/google-sheets-salesforce-pipeline-export

---

- **Team:** Operations
- **Tools:** Google Sheets, Salesforce
- **Difficulty:** easy
- **Setup time:** 5 min
- **Time saved:** 1-2 hrs/export

## How it works
1. **Query Pipeline** — Pull open opportunities from Salesforce with SOQL
2. **Enrich Accounts** — Look up account names and details for each deal
3. **Deduplicate** — Check existing sheet data before adding new rows
4. **Export to Sheets** — Append deals sorted by close date with calculated fields

## Example requests
- Export all deals closing this quarter to my pipeline tracker sheet
- Pull Salesforce opportunities over $50k in Negotiation stage to Google Sheets
- Build a weekly pipeline snapshot in my reporting spreadsheet from Salesforce

## Prompt

```markdown
## Task

Export your Salesforce pipeline to a Google Sheets spreadsheet for reporting and team visibility. Use @Salesforce/SOQL Query to pull open opportunities, @Salesforce/Find Account by Name to enrich with account details, @Google Sheets/Read Range to check existing data, @Google Sheets/Search Values to find and update existing entries, and @Google Sheets/Append Row to add new rows.

**Example:** Export all open opportunities closing this quarter to my pipeline tracker spreadsheet.

## Input

The user will provide:
1. Pipeline filters (stage, close date range, owner, minimum amount)
2. Google Sheets spreadsheet ID for the export
3. Optional: specific fields to include beyond the defaults

**Example:** "Export all opportunities in Negotiation or Proposal stage closing in Q1 2025 to spreadsheet ID 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"

## Context

### Query Strategy

1. Run a SOQL query to pull opportunities matching the user&apos;s filters:
   `SELECT Id, Name, StageName, Amount, CloseDate, OwnerId, AccountId, Probability, NextStep FROM Opportunity WHERE IsClosed = false`
2. Add filters for stage, close date, and amount as specified
3. For each opportunity, look up the Account name using Salesforce/Find Account by Name
4. Read existing spreadsheet data to identify which deals are already tracked
5. Append new deals and flag deals whose stage or amount has changed

### Column Structure

The spreadsheet should have these columns:
- Opportunity Name
- Account Name
- Stage
- Amount
- Close Date
- Probability
- Owner
- Next Step
- Days Until Close
- Last Updated

### Data Handling

- Calculate "Days Until Close" from today&apos;s date minus the CloseDate
- Flag deals closing within 14 days as urgent
- Sort by close date (soonest first) when appending
- If a deal already exists in the sheet, note it in the summary but don&apos;t duplicate
- Format amounts as currency (e.g., $50,000)

## Output

**Pipeline Snapshot:**
- Total open deals: [X]
- Total pipeline value: $[X]
- Weighted pipeline: $[X] (sum of amount * probability)
- Deals closing this month: [X]

**Stage Breakdown:**
| Stage | Deals | Value | Avg Days to Close |
|-------|-------|-------|-------------------|
| [Stage 1] | X | $X | X |

**Deals Added to Sheet:** [X] new, [X] already tracked

**Urgent Deals (closing within 14 days):**
| Deal | Account | Amount | Close Date | Next Step |
|------|---------|--------|------------|-----------|
| [Deal 1] | [Account] | $X | [Date] | [Step] |

**Recommendation:** [One sentence on pipeline health — e.g., "Pipeline is front-loaded with 60% of value closing in the next 30 days. Consider building more early-stage pipeline."]
```

## Related reading
- [Airtable Vs Google Sheets Automation](https://cotera.co/articles/airtable-vs-google-sheets-automation.md)
- [Salesforce Workflow Automation Ai](https://cotera.co/articles/salesforce-workflow-automation-ai.md)
- [Automate Google Ads Reporting Ai](https://cotera.co/articles/automate-google-ads-reporting-ai.md)

