Using {{customer.number}} in a squad
# support
r
We have a very basic squad that handles inbound phone calls. We have a tool that hits our backend endpoint:
/api/user/{{customer.number}}
When using this in a workflow or just a single assistant, we get this: ✅
/api/user/+1234567890
<---- working perfectly When using the same assistant with the same tool in a squad, we get this: ⚠️
/api/user/{{customer.number}}
<---- LiquidJS tag does not get replaced The documentation around this is very confusing. Is there some difference in customer variables being passed around when using assistants in a squad?
c
Hi Robert\_, I see you're inquiring about integrating dynamic variables within your assistant configuration. You can use dynamic variables such as
{{customer.number}}
to personalize the interactions by embedding customer-specific data. Here’s a quick guide: 1. **Set up Dynamic Variables**: Use double curly braces to define variables in your prompts (e.g.,
Hello {{customerName}}!
). 2. **API Call Payload**: When starting a call, send a JSON payload to customize the assistant behavior using
assistantOverrides
and
variableValues
. Example:
Copy code
json
   {
     "assistantId": "your-assistant-id",
     "assistantOverrides": {
       "variableValues": { "name": "John" }
     },
     "customer": { "number": "+1xxxxxxxxxx" },
     "phoneNumberId": "your-phone-id"
   }
3. **Server Integration**: Ensure your server endpoint handles Vapi requests, fetching necessary customer data from your CRM to populate these variables dynamically. Refer to the middleware setup for more details. You can find further information on implementing these variables on the [Vapi documentation for dynamic variables](https://docs.vapi.ai/assistants/dynamic-variables).
r
Hi im also experiencing this issue. Using {{customer.number}} in a squad, for an API request tool call. The value is not getting replaced rather sent to server explicitly as "{{customer.number}}" Call ID: 019b4d46-b28e-7dd1-b9dd-3fb2bd29f97b any ideas?
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.