toadilywasted
02/05/2025, 6:55 PM- The current date time is {{"now" | date: "%b %d, %Y, %I:%M %p", "America/New_York"}}.
which is taken almost directly from the Dynamic Variables docs: https://docs.vapi.ai/assistants/dynamic-variables
However, you can see in the screenshot that the message is just - The current date time is .
I'm running into the same issue trying to transform customer.number
to make it be spoken more naturally, since the agent frequently starts garbling and saying nonsense or switching to a strange robotic backup voice if it tries to read a phone number straight up. This is the template I'm trying to use for that: {{customer.number | remove_first: "+1" | split "" | join: ", "}},
. When I tried asking the agent for my number, it made one up entirely, and when I checked the message logs it had the same issue where it appeared no phone number was there.
Call ID (immediately hung up, just for seeing the message with missing interpolation): 4cbafbaa-d072-4c13-b9f3-47c51a7890e4
Thank you!Vapi
02/05/2025, 6:58 PMcustomer.number
variable isn't being passed correctly or there's a parsing issue.
To address these issues, I would recommend the following steps:
1. Double-check that the dynamic variables are correctly named and that the syntax matches the documentation.
2. Ensure that the variables you're trying to use (now
and customer.number
) are being passed to the system correctly and are available at the time the prompt is being generated.
3. If the above steps are correct, there might be a need for further investigation by the support team.
Since you've provided the Call ID, I can forward this information to the support team for a more in-depth analysis. Would you like me to do that for you?Vapi
02/05/2025, 6:58 PMVapi
02/05/2025, 6:58 PMShubham Bajaj
02/07/2025, 2:38 PMtoadilywasted
02/07/2025, 6:11 PMShubham Bajaj
02/11/2025, 10:37 PM{{"now" | date: "%b %d, %Y, %I:%M %p", "America/New_York"}}
Try the more straightforward:
{{now | date: "MMMM D, YYYY h:mm A"}}
And for the phone number, rather than:
{{customer.number | remove_first: "+1" | split "" | join: ", "}}
Just use:
{{customer.number}}
The reason this should work better is that I can see in our codebase that there are already built-in utilities that handle formatting numbers and dates in a voice-friendly way. You don't need to do the formatting in the template itself - the system will take care of that for you!
Give these simpler versions a try and let me know if you're still seeing any issues. We can always dig deeper if needed!toadilywasted
02/11/2025, 10:58 PMShubham Bajaj
02/11/2025, 11:06 PMShubham Bajaj
02/11/2025, 11:08 PM{{"now" | date: "%b %d, %Y, %I:%M %p", "America/New_York"}}
toadilywasted
02/11/2025, 11:12 PMtoadilywasted
02/11/2025, 11:15 PMtoadilywasted
02/13/2025, 4:56 PMc90c04cb-ad66-42fa-a78c-9a327c26a8a1
The current date time is .\n\n
Kyle
02/14/2025, 4:57 PM