> ## Documentation Index
> Fetch the complete documentation index at: https://docs.autocalls.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync Qualified Leads to Google Sheets

> Learn how to automatically add qualified leads to Google Sheets after successful AI phone calls

This tutorial shows how to set up an automation that automatically adds qualified leads to a Google Sheet after successful AI phone calls, creating a powerful lead tracking and CRM system.

<iframe width="100%" height="400" src="https://www.youtube.com/embed/kv09S5wuXMs?si=9Ic3VHwV-QeL5YER" title="Tutorial: How to sync qualified leads in a live Google Sheet" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

## What You'll Learn

* Setting up post-call automation with conditional logic
* Creating Google Sheets integration for lead tracking
* Configuring data mapping from calls to spreadsheet
* Building a qualified leads database automatically
* Monitoring and optimizing your lead collection process

## Prerequisites

* Configured AI assistant with post-call variables
* Google account with Google Sheets access
* Understanding of post-call webhook automation
* Access to call testing functionality

## Step 1: Set Up Post-Call Automation Trigger

We'll start by creating an automation that triggers when a phone call ends.

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/f61-X1V6FVdnwMPG/resources/tutorials/qualified-leads/01-create-new-flow.mp4?fit=max&auto=format&n=f61-X1V6FVdnwMPG&q=85&s=c2f23d441fc9e755a47caa5a25fe4406" data-path="resources/tutorials/qualified-leads/01-create-new-flow.mp4" />

1. **Navigate to Automation Platform**
2. **Create a new flow** from scratch
3. **Search for your calling platform** in the trigger section
4. **Select "Phone Call Ended"** trigger
   * This trigger activates when any call to your selected assistant completes

## Step 2: Configure Assistant and Load Data

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/f61-X1V6FVdnwMPG/resources/tutorials/qualified-leads/03-select-assistant.mp4?fit=max&auto=format&n=f61-X1V6FVdnwMPG&q=85&s=8cec483afa95ba4a5b9b90a30c8a4e4c" data-path="resources/tutorials/qualified-leads/03-select-assistant.mp4" />

1. **Select the assistant** you want to automate
   * Each assistant can only have one "phone call ended" automation
   * All calls to this assistant will go through this automation
2. **Click "Load Data"** to set up the webhook and load sample call data
   * This automatically configures the webhook on your assistant
   * Sample data from your recent calls will be loaded for use in the next steps

## Step 3: Verify Assistant Variables

Before proceeding, make sure your assistant has the right variables configured:

1. **Check post-call variables** in your assistant's "Post-call Actions" tab:
   * **status**: Boolean (true/false) indicating if call objective was achieved
   * **summary**: Text summary of the call conversation
   * These variables are extracted by AI after each call

<Frame>
  <img src="https://mintcdn.com/autocalls/f61-X1V6FVdnwMPG/resources/tutorials/qualified-leads/07-post-call-variables.png?fit=max&auto=format&n=f61-X1V6FVdnwMPG&q=85&s=da596947e874fab3a09cc0d6e92fb626" alt="Post-call variables configuration" width="1749" height="763" data-path="resources/tutorials/qualified-leads/07-post-call-variables.png" />
</Frame>

### Adding New Post-Call Variables

If you add a new post-call variable after creating the automation:

1. **Define the new variable** in your assistant's "Post-call Actions" tab and save
2. **Return to your automation** and click **"Load Data"** again to refresh the available fields
3. **Re-evaluate an existing call** if needed to extract the new variable from past calls

## Step 4: Add Conditional Logic for Qualified Leads

We only want to add leads to Google Sheets when the call objective was achieved.

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/f61-X1V6FVdnwMPG/resources/tutorials/qualified-leads/13-add-branch.mp4?fit=max&auto=format&n=f61-X1V6FVdnwMPG&q=85&s=d54267f3fa0961a1fb762ba165cb1598" data-path="resources/tutorials/qualified-leads/13-add-branch.mp4" />

1. **Click the "+" sign** to add a step
2. **Search for "Branch"** in control flow
3. **Select Branch** to create conditional logic

<video autoPlay muted loop playsinline src="https://mintlify.s3.us-west-1.amazonaws.com/autocalls/resources/tutorials/qualified-leads/14-configure-status-condition.mp4" />

4. **Configure the branch condition:**
   * **Select `status` variable** from call data
   * **Choose "Boolean is true"**
   * This creates two paths: True (qualified) and False (not qualified)

## Step 5: Create Google Sheets Integration

Now we'll set up the Google Sheets action for qualified leads (True branch).

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/f61-X1V6FVdnwMPG/resources/tutorials/qualified-leads/15-add-google-sheets-action.mp4?fit=max&auto=format&n=f61-X1V6FVdnwMPG&q=85&s=0cde9ebe557d86cf01f2b685521d75e7" data-path="resources/tutorials/qualified-leads/15-add-google-sheets-action.mp4" />

1. **On the True branch**, click the "+" sign
2. **Search for "Google Sheets"**
3. **Select "Insert Row"** action

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/f61-X1V6FVdnwMPG/resources/tutorials/qualified-leads/16-create-sheets-connection.mp4?fit=max&auto=format&n=f61-X1V6FVdnwMPG&q=85&s=99341267136d7e792eebdcb182c1a23b" data-path="resources/tutorials/qualified-leads/16-create-sheets-connection.mp4" />

4. **Create a new Google Sheets connection:**
   * Authorize with your Google account
   * Save the connection for future use

## Step 6: Set Up Your Qualified Leads Spreadsheet

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/f61-X1V6FVdnwMPG/resources/tutorials/qualified-leads/18-spreadsheet-headers.mp4?fit=max&auto=format&n=f61-X1V6FVdnwMPG&q=85&s=57a6e8126a5948bf069fe96db17ff4d0" data-path="resources/tutorials/qualified-leads/18-spreadsheet-headers.mp4" />

1. **Create a new Google Sheet** named "successful calls" for example

2. **Set up column headers:**
   * **Column A**: `phone_number`
   * **Column B**: `summary`
   * Add more columns for additional data as needed

## Step 7: Configure Spreadsheet Selection

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/f61-X1V6FVdnwMPG/resources/tutorials/qualified-leads/19-select-target-spreadsheet.mp4?fit=max&auto=format&n=f61-X1V6FVdnwMPG&q=85&s=876e980f9f2e1af27c9498e2b4fd57d0" data-path="resources/tutorials/qualified-leads/19-select-target-spreadsheet.mp4" />

1. **Return to your automation**
2. **Select your "successful calls" spreadsheet**
3. **Select the correct sheet** (usually "Sheet1")

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/f61-X1V6FVdnwMPG/resources/tutorials/qualified-leads/20-enable-headers.mp4?fit=max&auto=format&n=f61-X1V6FVdnwMPG&q=85&s=88d47cad311cc2aac9b675b309a9c683" data-path="resources/tutorials/qualified-leads/20-enable-headers.mp4" />

4. **Enable "First row contains headers"**:
   * This tells the automation about your column structure
   * Headers should automatically load and display

## Step 8: Map Call Data to Spreadsheet Columns

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/f61-X1V6FVdnwMPG/resources/tutorials/qualified-leads/21-map-phone-number.mp4?fit=max&auto=format&n=f61-X1V6FVdnwMPG&q=85&s=af1c94fcfc6e75462eaf0e0b52065720" data-path="resources/tutorials/qualified-leads/21-map-phone-number.mp4" />

1. **Map the phone number:**
   * Click on the `phone_number` field
   * **Select "Phone Call Ended"** data source
   * **Find and select the phone number** from call data
   * Click "Insert"

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/f61-X1V6FVdnwMPG/resources/tutorials/qualified-leads/23-map-summary.mp4?fit=max&auto=format&n=f61-X1V6FVdnwMPG&q=85&s=7f94142aecddbce9f77fe8f72f01dc35" data-path="resources/tutorials/qualified-leads/23-map-summary.mp4" />

2. **Map the call summary:**
   * Click on the `summary` field
   * **Navigate to "Post Call Variables"**
   * **Select the `summary` variable**
   * Click "Insert"

3. **Map any additional fields:**
   * Email from call variables
   * Call date/time from call metadata
   * Any custom variables you've defined

## Step 9: Test and Verify

<video autoPlay muted loop playsinline src="https://mintcdn.com/autocalls/f61-X1V6FVdnwMPG/resources/tutorials/qualified-leads/25-test-sheets-integration.mp4?fit=max&auto=format&n=f61-X1V6FVdnwMPG&q=85&s=152a37f2a609e02c70ef05d1b7126043" data-path="resources/tutorials/qualified-leads/25-test-sheets-integration.mp4" />

1. **Click "Test Step"** to verify the integration
2. **Check for successful execution**
3. **Go to your Google Sheet** to confirm:
   * New row was added with correct data
   * All mapped fields populated properly
   * Data formatting looks correct

## Step 10: Publish and Monitor

<Frame>
  <img src="https://mintcdn.com/autocalls/f61-X1V6FVdnwMPG/resources/tutorials/qualified-leads/27-publish-automation.png?fit=max&auto=format&n=f61-X1V6FVdnwMPG&q=85&s=b047dba81fc64180fdbb9ebde0845c10" alt="Publishing the automation" width="1753" height="765" data-path="resources/tutorials/qualified-leads/27-publish-automation.png" />
</Frame>

1. **Click "Publish"** to activate your automation
2. **Your qualified leads tracking is now live**
3. **Monitor automation performance:**
   * Check automation "Runs" for execution history
   * Verify qualified leads are being added to your sheet
   * Monitor for any failed executions

## Troubleshooting

### Common Issues

**Leads not appearing in spreadsheet:**

* Verify Google Sheets connection is authorized
* Check that automation is published and active
* Confirm calls are triggering `status` = `true`
* Verify branch condition is configured correctly

**Incomplete data in spreadsheet:**

* Check all field mappings in the automation
* Verify post-call variables are being extracted
* Confirm spreadsheet headers match automation fields
* Test with various call scenarios

## Next Steps

Once your qualified leads automation is working:

* **Add lead scoring** based on call quality
* **Create follow-up automations** for hot leads
* **Integrate with email marketing** platforms
* **Set up analytics dashboards** for conversion tracking
* **Expand to multiple campaigns** and lead sources

Your qualified leads will now be automatically captured and organized in Google Sheets, creating a powerful foundation for your sales and follow-up processes!
