Prince P Appiah
01/28/2026, 11:10 PMAI Evy
01/28/2026, 11:10 PMAI Evy
01/28/2026, 11:11 PM{{variable}} is sent to your API in its raw form instead of being resolved, this typically means the variable has no assigned value at the time of the function call. [(1) ]()
## Default Behavior for Missing Variables
When a dynamic variable has no assigned value, it remains in its raw form with the curly braces intact.
For example:
- If user_name is not provided: "Hello {{user_name}}, how can I help you today?"
- If user_name is "John": "Hello John, how can I help you today?"
## How to Fix This
1. Ensure the variable is set when creating the call — For outbound calls, set your variables in the retell_llm_dynamic_variables field when using the [Create Phone Call]() API. Note that all values must be strings.
2. Set default values at the agent level — You can configure default values for dynamic variables at the agent level. Default variables serve as a fallback and will only be used when specific variables aren't included in the call request.
3. For inbound calls — Supply dynamic variables in the Inbound Call Webhook.
## Using Variables in Custom Functions
In your custom function configuration, both the description and const value in query parameters can be dynamic variables. Description will be resolved by the LLM while const value will be applied directly to the function. [(2) ]()
If you're using a const value with a dynamic variable in your parameter schema, like:
json
"last_name": {
"type": "string",
"const": "{{last_name}}"
}
The variable still needs to be provided via retell_llm_dynamic_variables for it to resolve properly.AI Evy
01/28/2026, 11:11 PMAI Evy
01/28/2026, 11:11 PMPrince P Appiah
01/28/2026, 11:13 PMPrince P Appiah
01/28/2026, 11:13 PMPrince P Appiah
01/28/2026, 11:15 PMAI Evy
01/28/2026, 11:15 PMAI Evy
01/28/2026, 11:15 PM{{customer_code[:6]}} (using Python-style slicing) is not supported by Retell's dynamic variable system. [(1) ]()
Dynamic variables in Retell use the {{variable_name}} syntax and support nested variables like {{current_time_{{my_timezone}}}}, but they do not support string manipulation operations such as slicing or substring extraction within the curly braces.
## Workarounds
1. Extract the substring before passing it — When you set retell_llm_dynamic_variables in your API call, pre-process the value on your backend so you pass customer_code_prefix already containing just the first six digits.
2. Create a separate variable — Instead of trying to slice within the template, create a dedicated variable like {{customer_code_prefix}} that holds the truncated value.
3. Handle it in your custom function — Pass the full {{customer_code}} to your API and perform the substring operation on your backend.
I don't have documentation confirming that slicing syntax ever worked previously. If this behavior changed for you, I'd recommend reaching out to Retell support directly for clarification.
Check out these potentially useful sources:
- [Dynamic Variables]()
- [Extract Dynamic Variables]()
- [Contact Sales]()AI Evy
01/28/2026, 11:15 PMAI Evy
01/28/2026, 11:15 PM