https://retellai.com/?utm_source=discord&utm_medium=seo logo
How to set values to a dynamic variable in retell ...
# ❓・ai-evy-support
a
@AI Evy How to set values to a dynamic variable in retell conversation agent ?
a
Thanks for tagging me @afrah_85175. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) ​
### Answer To set values to dynamic variables in a Retell conversation agent, you have several methods depending on your call type [(1) ]() : ## For Outbound Calls When using the Create Phone Call API, set your variables in the
retell_llm_dynamic_variables
field :
Copy code
json
{
 "user_name": "John Smith",
 "product_name": "Premium Plan",
 "account_status": "active"
}
## For Inbound Calls You can supply dynamic variables in the Inbound Call Webhook . ## Setting Default Values You can also configure agent-level default dynamic variables that serve as fallbacks when specific variables aren't included in the call request . For conversation flows, you can set
default_dynamic_variables
at the conversation flow level [(2) ]() :
Copy code
json
{  
 "company_name": "Retell Inc",  
 "support_hours": "9 AM - 5 PM"  
}
## Important Requirements All values in
retell_llm_dynamic_variables
must be strings - numbers, booleans, or other data types are not supported [(1) ]() . ## Using Dynamic Variables Once set, you can reference these variables in your prompts using double curly braces :
Copy code
"Hello {{user_name}}, I understand you're interested in {{product_name}}. How can I help you today?"
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.