customer phone Dynamic variable in squad tool not ...
# support
r
Hi, Im trying to use {{customer.number}} in an API request tool, within a squad. Its not getting replaced with the customers phone number. call ID: 019b4e11-d622-722c-8dfb-a67d1e661eeb function name is sendLeadSms attributes.function.arguments contains "CustomerPhone": "{{customer.number}}" Im not sure if this is the model actually passing the string {{customer.number}} as an argument or liquidjs replacement is not working? I have this as the default value (pip attached). https://cdn.discordapp.com/attachments/1453422721999437824/1453422722301296833/image.png?ex=697ae0a4&is=69798f24&hm=6e58d3cc0462f25f3af146e89fef95c2dc42dae80eff1204917282de5ba71ed2&
v
Try explicitly passing the customer's phone number in your API request payload, rather than relying on the default value in the tool configuration. For example:
Copy code
json
"variableValues": {
  "CustomerPhone": "+14151234567"
}
This ensures
{{customer.number}}
is replaced correctly, as dynamic variables must be set in the API call or via the dashboard for each conversation according to the documentation. If the issue persists, double-check that the variable name matches exactly and is included in your call configuration as shown in the [Vapi dynamic variables guide](https://docs.vapi.ai/assistants/dynamic-variables). Source: - [Vapi Dynamic Variables Documentation](https://docs.vapi.ai/assistants/dynamic-variables)
r
This is for an inbound call. My current setup is a squad with 2 assistants. The first assistant does have the {{customer.number}} variable defined by default from the inbound call. Once handed off to the second assistant, it has access to an api tool (seen in my screenshot on the main page). When you say vapi does not resolve liquid variables inside the tool call function, can you clarify that? In my screenshot above you can see the liquid variable does turn purple. So either it should work and it's a bug or issue, or those tool text input boxes shouldn't show the purple variable replacement ui? Could you also explain what you mean by pass it from a previous state and map it directly?
c
Thanks for the detailed breakdown! Yes, the variable should be resolving, especially since it’s being highlighted as a dynamic variable in the dashboard. Given that behavior, we’ll need to check in with the team to review this and confirm whether it’s a bug or an issue with how variables are currently being parsed inside squad tool calls. We’ll update you once we hear back. In the meantime, a workaround is to handle it through prompt engineering so the model passes the correct value during the tool call. For example, you can add something like this to your system prompt:
Copy code
when calling the sendLeadSms tool, use {{customer.number}} as the value for CustomerPhone
This will instruct the model to insert the inbound caller’s number at runtime until the underlying variable behavior is confirmed. You can either use {{customer.number}} or "customer's phone number" in the prompt.