Google Sheets Integration
Connect your assistant to Google Sheets for seamless data entry.
The Google Sheets integration allows your Vapi assistant to interact with Google Sheets in a simple way:
- Add new rows to existing Google Sheets
This enables your assistant to record information and add data to spreadsheets directly during phone calls.
The Google Sheets integration currently only supports adding new rows to spreadsheets. It does not support reading from or modifying existing data in the spreadsheet.
Prerequisites
Before you can use the Google Sheets integration, you need to:
- Have a Google Sheets account
- Have access to the Vapi Dashboard
- Have an assistant created in Vapi
- Have a Google Sheet created and ready to receive data
Setup Steps
1. Connect Google Sheets Account
First, you need to connect your Google Sheets account to Vapi:
- Navigate to the Vapi Dashboard
- Go to Providers Keys > Tools Provider > Google Sheets
- Click the Connect button
- A Google authorization popup will appear
- Follow the prompts to authorize Vapi to access your Google Sheets
The authorization process will request access to your Google Sheets.
2. Create and Configure Sheets Tool
After connecting your Google Sheets account, create and configure the tool:
- Go to Dashboard > Tools page
- Click the Create Tool button
- Select Google Sheets from the available options
- Choose the Google Sheets Add Row Tool
- Provide a name and description explaining when it should be invoked
- Configure the tool with the following required fields:
spreadsheetId
: The ID of your Google Sheetrange
: The sheet name or range (e.g., “Sheet1” or “Sheet1!A:Z”)
To find your spreadsheet ID:
- Open your Google Sheet in a browser
- Look at the URL:
https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/edit
- Copy the SPREADSHEET_ID portion (it’s a long string of letters, numbers, and special characters)
The description field is crucial as it helps the AI model understand when and how to use the tool. Be specific about the scenarios and conditions when the tool should be invoked.
3. Add Tool to Assistant
Now, add the Google Sheets tool to your assistant:
- Navigate to Dashboard > Assistants page
- Select your assistant
- Go to the Tools tab
- In the tools dropdown, select the Google Sheets tool
- Click Publish to save your changes
Tool Configuration
Google Sheets Add Row Tool
This tool uses the following fields to add data to your spreadsheet:
spreadsheetId
: The ID of your Google Sheet (found in the sheet’s URL)range
: The range where the data should be added (e.g., “Sheet1” or “Sheet1!A:Z”)values
: An array of values to be added as a new row
The range field can be specified in two ways:
- Just the sheet name (e.g., “Sheet1”) - This will append to the next empty row
- Sheet name with range (e.g., “Sheet1!A:Z”) - This will append to the specified range
Example Usage
Here’s how the tool can be used in your assistant’s configuration:
Best Practices
- Data Validation: Ensure all data is properly formatted before adding to the spreadsheet
- Error Handling: Include fallback responses for cases where the tool fails
- User Confirmation: Always confirm with the user before adding data to the spreadsheet
- Sheet Structure: Be aware of the spreadsheet’s structure and column requirements