Nested variable in Assistant selector
# support
e
Is there a way to use nested object as a variable as assistant selector for squad? Eg: Below is a sample json
Copy code
"company": {
    "name": "company name",
    "contact": "company contact"
}
I want to use it in prompt like
Copy code
Hello {{company.name}}, my contact is {{company.contact}}
But this is not working. I have tried both json and stringified json. what is the implementation for this? I am trying to avoid flattening the entire object since the number of keys in it can be very high.
@Vapi Support Bot please check this
@Vapi please check
c
Hi elmo7, You can pass nested objects as variables via assistantOverrides.variableValues and reference their properties in templates (e.g., {{company.name}}). Use a JSON object in the call payload — do not stringify it. Example call body: { "assistantId": "your-assistant-id", "assistantOverrides": { "variableValues": { "company": { "name": "company name", "contact": "company contact" } } }, "customer": { "number": "+1xxxxxxxxxx" }, "phoneNumberId": "your-phone-id" } Notes from the docs: - Default variables are auto-filled; custom nested vars must be supplied in assistantOverrides.variableValues (see https://docs.vapi.ai/assistants/dynamic-variables). - In assistant prompts use {{company.name}} and {{company.contact}}. - If you use the assistant-selector webhook flow (personalization), return assistantOverrides with variableValues containing the nested object in your server response (see https://docs.vapi.ai/assistants/personalization). - If it’s still not working, confirm the incoming selector payload includes your assistantOverrides and that you’re not accidentally stringifying the object before sending. If you share the exact request body you’re sending