Questions

Conditional Logic

Guide the AI's behavior with free-text instructions per question.

Conditional Logic

Conditional logic allows you to give the AI custom instructions for how to handle specific answer patterns. It's a powerful way to make your interviews more adaptive and context-aware without rigid branching rules.

What Conditional Logic Is#

Conditional logic is a free-text field where you can write natural language instructions that tell the AI how to behave during a specific question's follow-ups. These instructions are injected into the AI's system prompt, so the AI honors them naturally during the conversation.

Unlike traditional survey logic (e.g., "If answer = X, skip to Question 5"), Diaform's conditional logic is flexible and conversational. You describe the behavior you want, and the AI adapts in real-time.

The Conditional Logic Field#

Each question has an optional Conditional Logic field:

  • Maximum length: 500 characters
  • Format: Free-text instructions in plain English
  • Visibility: Hidden from respondents (only used by the AI)

You can leave this field empty if you don't need custom behavior for a question.

Examples#

Here are real-world examples of how to use conditional logic effectively:

Example 1: Digging Into Pricing Concerns#

Question: "What has your experience been like using our product?"

Conditional Logic:

If the user mentions pricing concerns, ask about their budget expectations and what pricing model would work better for them.

What happens: If the respondent says "It's great, but a bit expensive," the AI will follow up with questions like "What's your budget for a tool like this?" or "Would a usage-based pricing model make more sense for you?"

Example 2: Following Up on Low Ratings#

Question: "How would you rate your onboarding experience from 1-10?"

Conditional Logic:

If rating is below 5, ask what specific improvements would raise it. If rating is 8 or higher, ask what made it smooth.

What happens: The AI tailors follow-ups based on the score—negative experiences get explored for actionable fixes, positive experiences get explored for what to double down on.

Example 3: Exploring Competitor Mentions#

Question: "If a colleague asked about us, what would you tell them?"

Conditional Logic:

If the user mentions a competitor, ask what they like better about that competitor and what we could learn from them.

What happens: If the respondent says "I'd tell them it's good, but I prefer Competitor X," the AI asks why Competitor X is better and what features or experiences stand out.

Example 4: Skipping Redundant Follow-Ups#

Question: "What's one thing you wish worked differently?"

Conditional Logic:

Skip follow-ups if the user gives a detailed answer right away. Only probe if their answer is vague or surface-level.

What happens: If the respondent provides a thorough, specific answer (e.g., "The export feature is clunky—it doesn't support CSV, and the interface is confusing"), the AI recognizes the detail and moves on. If they say "Not sure, maybe some small things," the AI asks follow-ups to dig deeper.

Example 5: Capturing Context for Churn#

Question: "Why are you leaving?"

Conditional Logic:

If the user mentions switching to another product, ask what prompted them to start looking and what the competitor offers that we don't. If they mention budget, ask if there's a price point that would change their decision.

What happens: The AI adapts its follow-up strategy based on whether the respondent is leaving due to a competitor, cost, product gaps, or other reasons.

How It Works Under the Hood#

When the AI processes a question with conditional logic:

  1. The instructions are added to the AI's system prompt for that question
  2. The AI reads the respondent's answer
  3. The AI evaluates whether the conditions described in your logic apply
  4. The AI adjusts its follow-up questions accordingly

This approach is more flexible than hard-coded branching because the AI can interpret nuance. For example, if you write "If the user mentions pricing concerns," the AI will catch variations like "too expensive," "can't afford it," "pricing is an issue," or "wish it was cheaper."

Best Practices#

Be Specific#

Vague instructions lead to unpredictable behavior.

Vague: "Ask more if they seem unhappy."

Specific: "If the user mentions frustration, bugs, or poor performance, ask for specific examples and how it impacted their work."

Use If/Then Style#

Structure your logic as conditional statements for clarity.

Good: "If the user mentions [X], ask about [Y]."

Confusing: "Ask about Y when X happens maybe."

Don't Contradict Probing Intensity#

Conditional logic works alongside probing intensity—it doesn't override it. If you set probing intensity to Low (max 2 follow-ups), the AI won't ask 10 follow-ups just because your conditional logic is ambitious.

Example of conflict:

  • Probing intensity: Low (2 follow-ups)
  • Conditional logic: "Ask 5 detailed follow-up questions about pricing, budget, and competitors."

What happens: The AI will ask up to 2 follow-ups, prioritizing the most important parts of your logic.

Keep It Under 500 Characters#

You have 500 characters to work with. Be concise and focus on the most important behavioral adjustments.

Test Your Logic#

After adding conditional logic, test the interview yourself (use "Try It Yourself" in the dashboard) to see how the AI interprets your instructions.

When to Use Conditional Logic#

Conditional logic is optional. Use it when:

  • You want the AI to adapt based on specific answer patterns (e.g., competitor mentions, low ratings)
  • You need to explore certain topics more deeply than others
  • You want to skip redundant follow-ups in certain cases
  • You're conducting specialized research (e.g., churn interviews, feature validation)

For general use cases, you don't need conditional logic—the AI's default behavior is already adaptive and conversational.

Next Steps#