https://retellai.com/?utm_source=discord&utm_medium=seo logo
an agent is pulling in a text field {{color}}
# ❓・ai-evy-support
o
@AI Evy an agent is pulling in a text field {{color}}. I want the agent to ask a certain set of questions only if color is blue. what syntax must i enter in the prompt to achieve this? I've tried {{color}} =blue | {{color}} ="blue" | {{color}} =='blue' No luck. it just skips over the question
a
Thanks for tagging me @obinna_98030. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, dynamic variables in Retell AI use the
{{variable_name}}
syntax [(1) ]() , but the documentation doesn't provide explicit syntax for conditional logic within prompts using comparison operators like
=
,
==
, or
!=
. For Single/Multi Prompt Agents, the recommended approach is to handle conditional logic through natural language instructions in your prompt rather than programming syntax [(2) ]() . You would write something like: "If the color is blue, ask the following questions: [list your questions]. Otherwise, skip these questions." However, if you need more deterministic conditional behavior based on variable values, you should consider using Conversation Flow instead of Single/Multi Prompt [(3) ]() [(2) ]() . Conversation Flow agents provide better control for complex logic and multiple decision branches [(2) ]() . The Prompt Engineering Guide emphasizes that when your agent needs to handle "multiple decision branches" or "state management," Conversation Flow is the better choice over trying to manage everything in a single prompt . I don't have specific documentation showing the exact syntax for conditional variable comparisons in prompts. I'd recommend checking out these resources or reaching out to support for guidance on implementing conditional logic based on dynamic variables: - [Prompt Engineering Guide]() - [Single/Multi Prompt Agent Overview]() - [Contact Sales](https://
retellai.octolane.com/) Would you like a general suggestion on how to structure this type of conditional logic?
​ To learn more, see the sources I considered: [[1] Step 2: Configure the basic settings](https://docs.retellai.com/build/single-multi-prompt/configure-basic-settings) [[2] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) [[3] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.