> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sondos-ai.com/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/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/01-create-new-flow.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=188dd1ce2f9ac86cf42820fe03f9dffd" 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 Webhook

<video autoPlay muted loop playsinline src="https://mintcdn.com/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/03-select-assistant.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=d6c6c07e2e3957348cdda5b78eff7c23" 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 "Test Trigger"** to generate the webhook
   * This creates a webhook URL in the background
   * The webhook is automatically saved to your assistant settings

## Step 3: Verify Webhook Configuration

<video autoPlay muted loop playsinline src="https://mintcdn.com/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/05-check-assistant-webhook.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=f1645007f41566746da4f5468f5e2893" data-path="resources/tutorials/qualified-leads/05-check-assistant-webhook.mp4" />

1. **Open a new tab** and navigate to your assistant
2. **Go to the third tab** "Post-call Actions"
3. **Verify the webhook URL** was automatically added

<Frame>
  <img src="https://mintcdn.com/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/06-webhook-settings.png?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=7a0478c3ebb637f0758d73340da9dc0f" alt="Webhook configuration settings" width="1759" height="772" data-path="resources/tutorials/qualified-leads/06-webhook-settings.png" />
</Frame>

4. **Review webhook settings:**
   * **Enabled**: Webhook will trigger after calls
   * **Completed calls only**: Only successful calls trigger automation
   * **All calls**: Change to "No" if you want all calls (including failed) to trigger

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

5. **Review post-call variables:**
   * **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

## Step 4: Generate Test Call Data

To configure our automation properly, we need actual call data to work with. We'll make a test call to generate the post-call variables.

<Frame>
  <img src="https://mintcdn.com/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/08-set-test-values.png?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=440f29458bb3f869b163f993df86b5a0" alt="Setting test values for call variables" width="935" height="861" data-path="resources/tutorials/qualified-leads/08-set-test-values.png" />
</Frame>

1. **Set real values** in your assistant's call variables:
   * **Set your name and email** for realistic test data
   * These will be the default values when testing from the assistant

<video autoPlay muted loop playsinline src="https://mintcdn.com/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/09-make-test-call.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=8c26b755a5dde353b5b870d015d765bc" data-path="resources/tutorials/qualified-leads/09-make-test-call.mp4" />

2. **Make a test call to generate webhook data:**
   * Click **"Speak to Assistant"** → **"Phone Call"**
   * **Answer when your assistant calls you**
   * **Respond positively** to ensure the `status` variable becomes `true`
   * **Complete the call objective** during the conversation
   * **End the call naturally**

<Note>
  In a real situation, the assistant will take data assigned to the lead. For testing, it uses the default values you just set.
</Note>

<video autoPlay muted loop playsinline src="https://mintcdn.com/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/10-check-call-results.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=5425a351f62c474cadf49c8772bc060c" data-path="resources/tutorials/qualified-leads/10-check-call-results.mp4" />

3. **Verify call results and variable extraction:**
   * **Navigate to your calls list** and find the recent call
   * **Click on the call** to view details
   * **Confirm the `status` variable is `true`** (call objective achieved)
   * **Review the extracted `summary`** - this contains AI-generated call summary
   * These variables are extracted after each call based on:
     * Call transcript
     * Variable descriptions
     * Variable types (Boolean for status)
     * System prompt context

<Note>
  The variables after a call are being extracted. You can refresh the page after about a minute and then you will see the extracted variables.
</Note>

## Step 5: Configure Automation with Call Data

<video autoPlay muted loop playsinline src="https://mintcdn.com/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/11-received-call-data.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=046c18bcaf6c9e034c7e05a9730a3462" data-path="resources/tutorials/qualified-leads/11-received-call-data.mp4" />

1. **Return to your automation tab**

2. **Verify you received call data** from the test trigger
   * You should see the webhook data because you clicked "Test Trigger" and then made a call
   * The automation received the request after the call ended and variables were extracted

3. **Alternative method - resend webhook data from existing calls:**

<video autoPlay muted loop playsinline src="https://mintcdn.com/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/12-resend-webhook.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=f679427c624533eec95a655ada142f18" data-path="resources/tutorials/qualified-leads/12-resend-webhook.mp4" />

* If you need to test with different call data, you can reuse any existing call
* **Click "Test Trigger"** again in your automation
* **Go to any completed call** in your platform
* **Click "Resend Webhook"** to push that call's data to your automation
* **Return to automation tab** to see the updated data

### Adding New Post-Call Variables

<Note>
  If you need to add a new post-call variable after creating the automation, follow this process to update your automation with the new variable data.
</Note>

<video autoPlay muted loop playsinline src="https://mintcdn.com/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/add-variable.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=359264b7b81743576960d817f1499770" data-path="resources/tutorials/qualified-leads/add-variable.mp4" />

1. **Define the new variable in your assistant:**
   * Go to assistant settings → "Post-call Actions" tab
   * Add your new post-call variable (name, type, description)
   * **Save the assistant**

2. **Update automation with new variable data:**
   * **Return to your automation**
   * **Click "Test Trigger"** to prepare for new webhook data

3. **Re-evaluate an existing call:**

<video autoPlay muted loop playsinline src="https://mintcdn.com/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/re-evaluate.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=091e9502cfcb03f5f3dc094025bafd90" data-path="resources/tutorials/qualified-leads/re-evaluate.mp4" />

* **Go to any completed call** for this assistant
* **Click "Re-evaluate"** to extract the new variable from that call
* **Wait for processing** to complete

4. **Send updated data to automation:**
   * **Click "Resend Webhook"** on the same call
   * **Return to automation tab**
   * **Verify the new variable** is now available in your automation data

<Tip>
  This resend feature is useful for testing different scenarios without making new calls every time.
</Tip>

## Step 6: 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/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/13-add-branch.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=247c52b2c492cb60c06616091293dfee" 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/d10/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 7: 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/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/15-add-google-sheets-action.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=dc4b779f84d59255451c07447a6c7dd0" 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/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/16-create-sheets-connection.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=b1f7531c70cddadd8f815f2a61b8ca26" 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 8: Set Up Your Qualified Leads Spreadsheet

<video autoPlay muted loop playsinline src="https://mintcdn.com/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/18-spreadsheet-headers.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=13052d75197f95efc7b077c74ce9bee6" 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 9: Configure Spreadsheet Selection

<video autoPlay muted loop playsinline src="https://mintcdn.com/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/19-select-target-spreadsheet.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=87377c3df82a0152cf3646b0ccbf2b17" 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/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/20-enable-headers.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=55923711564d4515f8a4618ad084058a" 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 10: Map Call Data to Spreadsheet Columns

<video autoPlay muted loop playsinline src="https://mintcdn.com/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/21-map-phone-number.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=75556ce0255dac21239630928f8d84f9" 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/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/23-map-summary.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=1614a91a1fa3503e0ff1138a4a4f012b" 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 11: Test and Verify

<video autoPlay muted loop playsinline src="https://mintcdn.com/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/25-test-sheets-integration.mp4?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=826bc94b01b1fe4c5a265fe500521e33" 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 12: Publish and Monitor

<Frame>
  <img src="https://mintcdn.com/d10/YpDX10oobUPC61th/resources/tutorials/qualified-leads/27-publish-automation.png?fit=max&auto=format&n=YpDX10oobUPC61th&q=85&s=d32b90a3c941a6aa4c16bbeca025f8ec" 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!
