Starting the call by saying a lead's name from a G...
# prompt-tip
l
At the start of a call I want the agent to say, "Hi, [person's name]." It will determine the person's name by looking at the cell under the "First Name" column that's in the same row as the phone number it is receiving a call from. When I try to prompt this in the tool, in the identity and the response guidelines sections, the agent can't gather the name and just says the variable name that I have in brackets in the prompt regardless of if I tell it to never read what is in square brackets. How can I implement this? Thanks.
u
Hi, where are you initiating the conversation from? Are you using n8n?
Refer to this, you can pass in variables to your call when intitiating it through the API: https://docs.vapi.ai/assistants/dynamic-variables
@Logos
a
you will want to use {{customer.name}} as the variable, ex: "Hi {{customer.name}}, intro"
l
I'm just using VAPI
Good to know. How would I initiate it with the API?
@Umer @ABC1235
a
You would just use it in the prompt/workflow. When uploading lists, you will need a column for name and number. This will pull the customer name when declaring the {{customer.name}} variable
u
this ^ @Logos
l
As far as uploading a file, can I do this with a live Google Sheet that's pulled in with the Google Sheets tool? How would I pull a different name based on the number? I'll have thousands of different numbers and names in the sheet
a
Is the agent intended for outbound or inbound calls? For outbound campaigns use the following format and export as a csv which you upload to an outbound campaign, this can be done automatically with the API: Name | Number John | +1XXXXXXXXXX For inbounds I would use an intro that asks the customer name: "Hi, who do I have the pleasure of speaking with?" [customer response] "Hi {{customer.name}}, rest of pitch
correction to format for outbound: Number | Name number can be in the following formats: 1XXXXXXXXXX +1 (XXX) XXX-XXXX +1-XXX-XXX-XXXX
l
Thanks. For inbounds I'll be saying the name as well Do I use the same format?
a
I would do so the following way in your assistant/workflow: Intro: "Hi, who do I have the pleasing of speaking with?" Then for follow up responses use the {{customer.name}} variable when you want to use their name in your script. example: "Great to hear from you, {{customer.name}}. *rest of next response*"
You will want to use 2 models. one for outbound and one for inbound.
l
Let me clarify, I want inbound calls to say their name at the start of the call from the spreadsheet as well, just like outbound calls
I'm building one agent that will do outbound calls, another inbound that will use this feature
r
If you are getting their name from a sheet or some database, you will most likely need an
assistant-request
webhook configured. You can configure the webhook to hit n8n or [make.com](http://make.com) where your sheet/database is located so when Vapi sends the
assistant-request
webhook, you can define the {{customer.name}} variable in the
assistantOverrides.variableValues
object.
l
I've realized with the Google Sheets tool I can only add rows. I'm using these agents for a lot of calls and would rather not increase my expenses by using Make or n8n. Would there be a way to create a custom tool to read data from the Google Sheet just using VAPI's infrastructure? @ABC1235 @Umer
r
Here’s a clean response you can paste directly into the reply box: --- It is possible to read from a live Google Sheet, but it requires a custom external integration — VAPI itself cannot natively read arbitrary rows from Sheets. You would need to build a small web server that talks to the Google Sheets API and then expose an endpoint that VAPI can call from a custom tool. Below is the architecture you’d follow: How It Works 1\. You Host Your Own Server You spin up a small server (AWS Lambda, Vercel, Railway, etc.) that: - Receives HTTP POST requests from VAPI - Uses the Google Sheets API (with your credentials) - Looks up the row based on the caller’s phone number - Returns the name or whichever fields you need This server handles authentication and Sheets access — VAPI never touches your credentials. 2\. You Register a Custom Tool in VAPI You then create a VAPI tool that points to your server, for example:
Copy code
json
{
  "type": "function",
  "function": {
    "name": "readGoogleSheet",
    "description": "Read data from Google Sheets",
    "parameters": {
      "type": "object",
      "properties": {
        "spreadsheetId": { "type": "string" },
        "range": { "type": "string" }
      }
    }
  },
  "server": {
    "url": "https://your-server.com/sheets-endpoint",
    "timeoutSeconds": 20,
    "credentialId": "webhook-credential-id"
  }
}
Then your assistant can call this tool at the start of the call, receive the name, and set
{{customer.name}}
dynamically using
assistantOverrides.variableValues
. --- This approach works well, but it does require some engineering work: creating the server, handling Google auth, and returning structured responses for the agent.