The variableValues are not getting mapped to the d...
# support
r
The variableValues are not getting mapped to the dynamic variables in the system prompt except the first message prompt I verified the variableValues sent over to the vapi assistant via the .start() function of Vapi Web SDK. here is the call id - 9e233c29-20b3-4536-b493-1efb6d1231ab
v
Check if you're using the correct syntax for dynamic variables and ensure you're using the
messages
array instead of the deprecated
systemPrompt
property:
Copy code
javascript
const assistant = {
  model: {
    messages: [
      {
        role: 'system',
        content: 'Hello {{name}}!' // Use double curly braces
      }
    ]
  }
};

// When starting the call
vapi.start("assistantId", {
  variableValues: {
    name: "John" // Ensure variable names match exactly
  }
});
According to [Vapi documentation](https://docs.vapi.ai/assistants/dynamic-variables), variable names must match exactly between your system prompt and variableValues object. Sources: - [Vapi Dynamic Variables Documentation](https://docs.vapi.ai/assistants/dynamic-variables) - [Discord Discussion](https://discord.com/channels/1211482211119796234/1337126843790397591)
Check if you're using the correct syntax for dynamic variables and ensure you're using the
messages
array instead of the deprecated
systemPrompt
property:
Copy code
javascript
const assistant = {
  model: {
    messages: [
      {
        role: 'system',
        content: 'Hello {{name}}!' // Use double curly braces
      }
    ]
  }
};

// When starting the call
vapi.start("assistantId", {
  variableValues: {
    name: "John" // Ensure variable names match exactly
  }
});
According to [Vapi documentation](https://docs.vapi.ai/assistants/dynamic-variables), variable names must match exactly between your system prompt and variableValues object. Sources: - [Vapi Dynamic Variables Documentation](https://docs.vapi.ai/assistants/dynamic-variables) - [Discord Discussion](https://discord.com/channels/1211482211119796234/1337126843790397591)
k
Ensure dynamic variables are explicitly defined in each prompt using the
{{variableName}}
syntax and consistently passed with assistant overrides to avoid issues in subsequent messages.
r
Yeah it is not at all the problem as I have verified in my query
Just have a look as I have already shared my callId
k
Looking into it
config
Copy code
"firstMessage": "Hello Abraham Richard I'm Josh Bersin, and I'll be conducting your interview today, Shall we begin",
      "firstMessageInterruptionsEnabled": false,
      "firstMessageMode": "assistant-speaks-first",
current
(
{{candidateProfile}}
)
expected
{{candidateProfile}} Use the dynamic variables in the expected format. Due to its current format, the parsing ignores them considering non-dynamic variable syntax, and that's why it's not getting applied.
3 Views