Access database api
# support
a
My assistant should call my customer and with that phone number, search in the database and extract a json file. Ive been fighting with this problem for hours. Everything works fine but the assistant isn’t extracting the correct phone number. https://cdn.discordapp.com/attachments/1382571111212126229/1382571111966838854/IMG_5459.jpg?ex=684ba330&is=684a51b0&hm=8ec640221f0aaaec2e6221bcb0e2ce10cb41f5ff589e65cc6bf46ba4e8466f3f&
v
To ensure the assistant extracts the correct phone number, make sure your outbound call payload includes the
customer
object with the
number
field, and reference it as
{{customer.number}}
in your function or prompt.
Example payload:
Copy code
json
{
  "assistantId": "your-assistant-id",
  "phoneNumberId": "your-phone-id",
  "customer": {
    "number": "+11231231234"
  },
  "assistantOverrides": {
    "variableValues": {
      // other variables if needed
    }
  }
}
In your API request, use
"phone_input": "{{customer.number}}"
. Double-check that the variable is spelled exactly as shown and that the customer number is present in the payload. [See official docs for details.](https://docs.vapi.ai/assistants/dynamic-variables) Sources: - [Vapi Docs: Dynamic Variables](https://docs.vapi.ai/assistants/dynamic-variables) - [Vapi Docs: Outbound Calling](https://docs.vapi.ai/calls/outbound-calling)
v
Message marked as helpful by @! AetherMind! 🎉
c
Hey! To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) - What response you expected to get - What response you actually got instead This would really help us figure out what went wrong!
2 Views