https://retellai.com/?utm_source=discord&utm_medium=seo logo
transitions with dynamic variables & equation do n...
# 💬・general
m
@AI Evy transitions with dynamic variables & equation do not work out for me #❓・bug-report
a
Thanks for tagging me @mariag8602. I'll look through relevant sources and get back to you shortly.
### Answer Based on the sources, here are several potential issues and solutions for dynamic variable transitions in Conversation Flow: Common Issues with Dynamic Variable Transitions: 1. **Variable Existence Checking**: You can check if a dynamic variable exists using equation conditions like
{{variable_name}} exists
or
{{variable_name}} does not exists
[(1) ]() . This is particularly useful when variables might not be set. 2. **Function Result Transitions**: If you're using functions that return data, you need to extract the results into dynamic variables first [(2) ]() . The function results themselves cannot be directly used in equation transitions - they must be extracted as dynamic variables. 3. **Variable Types and Syntax**: Equation conditions support different comparison operators [(1) ]() : - String comparisons:
{{user_location}} == "New York"
- Numerical comparisons:
{{user_age}} > 18
- Contains operations:
"New York, Los Angeles" CONTAINS {{user_location}}
- Existence checks:
{{name}} exists
Troubleshooting Steps: 1. **Verify Variable Setting**: Make sure your dynamic variables are properly set. For inbound calls, system variables like
{{user_number}}
should be automatically available [(3) ]() . 2. **Check Variable Extraction**: If you're using custom functions, ensure you're extracting the results into dynamic variables using the Extract Dynamic Variable tool [(4) ]() . 3. **Test Variable Values**: Add the variable directly in a static message (like
{{variable_name}}
) to verify it's being popul
ated correctly [(5) ]() . 4. **Equation Order**: Remember that equation conditions are evaluated from top to bottom, and the agent transitions on the first condition that evaluates to true [(1) ]() . If you're still experiencing issues, could you share more details about: - Which specific dynamic variables you're using - Whether they're custom variables or system variables - The exact equation conditions you've set up This will help identify the specific cause of the transition failures.
​ To learn more, see the sources I considered: [[1] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) [[2] equation transition from functions stopped working](https://discord.com/channels/1186424376300679209/1381225091555266632) [[3] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[4] Extract Dynamic Variables](https://docs.retellai.com/build/single-multi-prompt/extract-dv) [[5] {{user_number}} does not work in Conversation Flow](https://discord.com/channels/1186424376300679209/1428211380930220042) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
I pass variables when we place a call, and it is called {{day}}. When I put {{day}} in the prompt, it actually shows the right number. But transition is still not working when I set equation to {{day}} = 1
@AI Evy I pass variables when we place a call, and it is called {{day}}. When I put {{day}} in the prompt, it actually shows the right number. But transition is still not working when I set equation to {{day}} = 1
a
Thanks for the follow-up, @mariag8602. I'll get back to you soon.
### Answer The issue is likely with the comparison operator syntax in your equation condition [(1) ]() . Based on the documentation, you should use double equals (
==
) instead of single equals (
=
) for comparison . Change your equation condition from: -
{{day}} = 1
To: -
{{day}} == 1
The documentation shows that equation conditions use the double equals operator for comparisons :
Copy code
- {{user_age}} > 18
- {{current_time}} > 9 AND {{current_time}} < 18
- {{user_location}} == "New York"
- {{user_location}} != "New York"
Since your
{{day}}
variable is displaying correctly in the prompt, this confirms the variable is being passed properly [(2) ]() . The transition issue is most likely due to using the incorrect comparison operator syntax [(1) ]() . Also note that all values in dynamic variables must be strings [(2) ]() . If you're passing the number
1
, make sure your equation condition compares it as a string:
{{day}} == "1"
.
​ To learn more, see the sources I considered: [[1] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) [[2] 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.
m
@AI Evy you do not have such option in UI
a
Thanks for the follow-up, @mariag8602. I'll get back to you soon.
### Answer Based on the documentation, you're correct that the UI may not provide all comparison operators. Looking at the equation conditions examples in the documentation, the supported operators for equation conditions include [(1) ]() :
Copy code
- {{user_age}} > 18
- {{current_time}} > 9 AND {{current_time}} < 18
- {{user_location}} == "New York"
- {{user_location}} != "New York"
- "New York, Los Angeles" CONTAINS {{user_location}}
- "New York, Los Angeles" NOT CONTAINS {{user_location}}
- {{user_age}} < 18 OR {{user_location}} == "New York"
- {{name}} exists
If the UI doesn't provide the
==
operator option, you have a few alternatives: 1. Use numerical comparison operators if available: Try
{{day}} > 0
and
{{day}} < 2
to check if day equals 1 2. **Use string contains**: If the UI supports CONTAINS, you could try
"1" CONTAINS {{day}}
3. **Use existence checking**: You could set up different dynamic variables for different day values and use
{{day_1}} exists
4. **Use prompt conditions instead**: Since equation conditions may be limited in the UI, you could use a prompt condition like "User's day variable is 1" instead of an equation condition The documentation notes that equation conditions are evaluated first, then prompt conditions, so if the UI limitations prevent proper equation setup, prompt conditions can be an effective alternative .
​ To learn more, see the sources I considered: [[1] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.