Analysis Plan and Overrides
# support
r
I'm almost sure that I used to be able to set up variables in the prompt of the analysis plan, but now it doesn't work. I'm using javascript sdk:
Copy code
await vapiClient.calls.create({
      assistantId,
      phoneNumberId: vapiPhoneNumbers[phoneNumberIndex],
      customer: { number: rawNumber, numberE164CheckEnabled: true },
      assistantOverrides: { variableValues: { ...callVariables } },
    });
In my callVariables, I have one called "today", and I have that variable in my Prompt on the Structured Data:
Copy code
You will be given a transcript of a call and a system prompt for the AI voice assistant. Determine the call was successful and whether the recipient of the call booked a meeting.

Consider today as {{today}}.
But that value is completely ignored, the one in the assistant prompt is replaced and works as expected, but my variable in the analysis plan thinks it's 2023.
v
Currently, dynamic variables (like
{{today}}
) passed via
assistantOverrides.variableValues
are only supported in the assistant's system prompt and dashboard messages—not in analysis plan prompts (such as structured data or summary prompts).
This matches the behavior you're seeing, where the variable works in the assistant prompt but not in the analysis plan. If you need this feature, I recommend submitting a feature request or reaching out to [Vapi support](support@vapi.ai) for clarification or to report this as a possible regression. Sources: - [Vapi Docs: Dynamic Variables](https://docs.vapi.ai/assistants/dynamic-variables) - [Vapi Docs: Call Analysis](https://docs.vapi.ai/assistants/call-analysis) - [Vapi Support](https://docs.vapi.ai/support)
r
So there's no way I can use dynamic variables in the analysis plan prompt, unless I do it myself?
v
Correct—currently, there is no built-in way to use dynamic variables in analysis plan prompts. If you need to inject values like
{{today}}
, you'll have to manually replace them in your prompt string before sending it to Vapi, for example:
Copy code
js
const prompt = `...Consider today as ${callVariables.today}.`;
If this is a critical feature, consider submitting a feature request to Vapi support for future updates. Sources: - [Vapi Docs: Dynamic Variables](https://docs.vapi.ai/assistants/dynamic-variables) - [Vapi Docs: Call Analysis](https://docs.vapi.ai/assistants/call-analysis) - [Vapi Support](https://docs.vapi.ai/support)
v
Message marked as helpful by @rbrun! 🎉
k
checking if this is resolved/solved for you?
r
I had to manually overwrite my variable in the analysis plan prompt in my server. It solved my question, but ideally I feel that this is something that should be a feature in the future.
k
Glad the issue was resolved. If you would like to suggest this as a feature, you can suggest it here: