rare-sapphire•2w ago
customer number
I'm trying to send the customer.number variable through to a google scripts api with a tool, but vapi isn't populating it like my other extracted variables when i do a full trial call, it just sends through the default value "unknown" any ideas how i should reference it

1 Reply
Hi keenan,
When you're trying to pass the
{{customer.number}}
variable and it defaults to "unknown", it often indicates that the variable isn't set at the call initiation. Here are a few checks and steps you can take:
1. Ensure Proper Configuration: Verify that the call setup includes the correct mapping for the caller's phone number. The {{customer.number}}
variable should be automatically populated with the phone number of the incoming call if everything is configured correctly.
2. Variable Usage: Double-check that {{customer.number}}
is included appropriately in both the prompt and the dynamic variable setup of your assistant. Make sure there are no syntax errors, and it's consistently applied using the double curly braces.
3. Call Source Check: If you're using a server to handle incoming calls, ensure that it correctly sends back the customer's phone number to Vapi. As suggested in similar cases, using your own server endpoint to fetch and validate incoming call details before responding to Vapi can help filter and set these variables properly.
For more details on handling such variables and ensuring they are dynamically populated, you might find the Dynamic Variables Documentation helpful.
Feel free to test these steps in the environment where the issue arises to see if it resolves the "unknown" value problem.Variables | Vapi
Personalize assistant messages with dynamic and default variables