Have the Bot Say Lead's Name
# support
s
I would like to have our Vapi Assistant to greet the customer with their name. I used this page in the documentation as a reference: https://docs.vapi.ai/assistants/dynamic-variables The problem is, everytime the bot calls the customer it doesn't greet them by mentioning the customer's name. Currently, I have a custom webhook setup in a workflow in GHL to connect it to Vapi and make the call. In the webhook, I wrote this:
Copy code
{
  "assistantId": "f3b1c374-1e5b-47e8-aa03-8cdbe0df67c8",
  "phoneNumberId": "e640fea1-5a5f-4b2f-9e6c-0f65e4e9ccfd",
  "assistantOverrides": {
    "variableValues": {
      "name": "{{contact.name}}",
      "Property": "{{contact.address1}}"
    }
  },
  "customer": {
    "number": "{{contact.phone_raw}}"
  }
}
And in the Assistant's System Prompt, an instruction on how to greet the customer: "When greeting the customer, say something like 'Hi, {{name}}!'" Is this how you properly setup the webhook in JSON and how you reference the variable within the system prompt? If not, please provide me some corrections. Thank you!
v
Your JSON structure and system prompt reference look correct! One thing to check is if GHL is properly replacing
{{contact.name}}
with the actual name before sending to Vapi. Try testing with a hardcoded name first:
Copy code
json
"variableValues": {
  "name": "John Doe",
  "Property": "{{contact.address1}}"
}
If this works, the issue is likely with how GHL is processing the variable. Source: - [Dynamic Variables in Vapi](https://docs.vapi.ai/assistants/dynamic-variables)
v
Message marked as helpful by @sibyorself! 🎉
u
Hi Have you been able to fix this?
u
Hi
s
Testing with a hardcoded name worked. The Assistant actually mentioned then name I inputted. But whenever I switch to a custom field inside the webhook, the Assistant is unable to mention the name during the call. So the issue is likely with how GHL is passing the variable. So far, I haven't figured out a fix for this one. The workaround I'm using is just having multiple workflows for each client so that I can customize each workflow's webhook with the client's name hardcoded in it. Until I'm able to figure out how to pass the variables properly from GHL to Vapi.
k
Your JSON setup looks correct, but in your system prompt, replace the instruction-style text with a direct greeting like: “Hi, {{name}}!”, this allows Vapi to substitute the actual name instead of saying the placeholder..
5 Views