https://retellai.com/?utm_source=discord&utm_medium=seo logo
why is the dynamic variable {{user_number}} not pa...
# ❓・ai-evy-support
a
@AI Evy why is the dynamic variable {{user_number}} not passed through the webhook but when calling from an actual number it does?
a
Thanks for tagging me @alexh_revanov_00040. I'll look through relevant sources and get back to you shortly.
### Answer The dynamic variable {{user_number}} is set based on the actual phone number involved in a real call—specifically, for inbound calls it's the from_number, and for outbound calls it's the to_number [(1) ]() [(2) ]() . When you simulate or trigger a webhook manually (rather than through an actual phone call) , the system may not have a real phone number context to populate {{user_number}}, so it remains unset or empty . In real calls, the telephony layer provides this data, but in webhook/test scenarios, unless you explicitly provide the number in the payload as expected by the system, the variable won't be auto-filled [(3) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Simulation Testing Now Live for All Agents](https://www.retellai.com/changelog/simulation-testing-now-live-for-all-agents-c27zh) [[3] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
but some reason, it was working before in the test, now it doesn't, weird
@AI Evy but some reason, it was working before in the test, now it doesn't, weird
a
Thanks for the follow-up, @alexh_revanov_00040. I'll get back to you soon.
### Answer The variable {{user_number}} is only auto-populated during actual phone calls because it relies on real telephony context—specifically, it is set to the from_number for inbound and to_number for outbound calls. In test or webhook simulations, unless the payload explicitly includes the expected phone number, the system does not have real telephony data to fill {{user_number}} automatically. If it previously worked in tests, it's possible the test mechanism or webhook payload included a value for user_number at that time, but recent changes require it to be set explicitly in non-call scenarios [(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
so how do we send over the number during test? what variable to set?
@AI Evy so how do we send over the number during test? what variable to set?
a
Thanks for the follow-up, @alexh_revanov_00040. I'll get back to you soon.
### Answer To send over the number during a test or webhook scenario, you should set the variable that the system uses to populate {{user_number}}. According to the documentation, {{user_number}} is derived from the actual user's phone number (from_number for inbound, to_number for outbound calls) . In a test or simulated context, you should explicitly set the value for user_number as a string in your dynamic variables payload:
Copy code
json
{
  "user_number": "+12137771234"
}
This will ensure that {{user_number}} is populated in your test just like in a real call [(1) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy would this be set in the functions ui? or in the overall dash in the ai agent
a
Thanks for the follow-up, @alexh_revanov_00040. I'll get back to you soon.
### Answer You can set dynamic variables like user_number in two main ways: - For individual calls (such as API-triggered or test scenarios) , you set user_number directly in your dynamic variables payload when making the call or test request [(1) ]() . - You can also configure default values for dynamic variables at the agent level in the overall AI agent settings/dashboard. These defaults serve as a fallback and are used when specific values aren’t provided in the call request [(1) ]() [(2) ]() . If you want user_number to be available in all calls unless explicitly overridden, set it as a default dynamic variable in the agent’s configuration. If you want to specify it for a particular function or test, set it in the dynamic variables payload for that specific request .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] List Retell LLMs](https://docs.retellai.com/api-references/list-retell-llms) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.