Retrieve contact name and add to prompt
# support
w
Im stuck! I want to post caller number via make.com to search Google contacts for known person. Then have prompt use the retrieved name. I want this to be the first action. I have this working yet i can't get assistant to speak the retrieved name? Do we use variables in prompt {{name}}
v
Yes, you should use
{{name}}
in your prompt, but you must also set the variable value in your API call. For example:
Copy code
json
{
  "assistantOverrides": {
    "variableValues": {
      "name": "John"
    }
  }
}
Then, in your prompt: Hello, {{name}}! This will make the assistant speak the retrieved name if the variable is set correctly in your call configuration. [See documentation for details.](https://docs.vapi.ai/assistants/dynamic-variables) Source: - [Variables Vapi Documentation](https://docs.vapi.ai/assistants/dynamic-variables)
v
Message marked as helpful by @WasabiBoy! 🎉
w
Im using make.com so what should the response json look like with Name as the variable. I have in Prompt Hello {{Name}} Just cant get the response jsopn back. Also using workflows too My current api response is { "results": [ { "toolCallId": "894757f91", "result": "3. Given Name" } ] } should it be { "results": [ { "toolCallId": "894757f91", "result": assistant-overrides='{ "variableValues": { "Name": "John Doe" } } ] }
c
Hello, Thanks for reaching out to us. We are sorry for the inconvenience. Can you give more details about your concern? Your Org ID, email address and other details that will help us pinpoint your account and to look further into it? We will investigate further and we appreciate your kind understanding and patience.
w
What Im struggling with is getting a tool call back to workflows Its documented on assistantid and Ive changes my response calls to workflowid but cant get the response into chat. In short my goal is to send the caller phone number to a DB lookup the contact name and return so I can name the caller. This is to make ure they are in the contact DB first, else I have a different response. I'd prefer to use workflows. I cant find a resource on how to do this My prompt is Hello {{Caller_Name}} how can I help today etc..... In workflow I have a toolcall first then the prompt
c
assistantOverride.variableValues must be set before the call is started otherwise will not work.
w
Thanks, but can you call a workflowId insterad of assistantId?
c
Yes—if you’re making an API request to the
/call
endpoint, you can specify a
workflowId
in place of an
assistantId
.
2 Views