---
title: "Conditional Logic: Show/Hide Sections and Fields Dynamically."
url: "https://help.ontraccr.com/en/article/conditional-logic-show-hide-sections-and-fields-dynamically"
language: "en"
last_updated: "2025-05-26T20:36:35.339Z"
---

# Conditional Logic: Show/Hide Sections and Fields Dynamically.

## 📄 Conditional Logic: Show or Hide Fields and Sections Based on Answers  
 

Conditional logic lets you build **smart, streamlined forms** that only show users what they need to see. You can hide or reveal fields and sections based on how someone answers previous questions—keeping forms clean, relevant, and fast to complete.

* * *

## 🧠 What is Conditional Logic?

Conditional logic allows you to:

-   Show or hide **individual fields** or **entire sections**
-   Base those decisions on previous answers
-   Use **AND/OR** rules to combine multiple conditions

* * *

## 🛠 How to Use Conditional Logic

### 🟢 For Fields

1.  In **Step 2: Fields**, add or edit a field
2.  Scroll to the option: `**Show this field conditionally**`
3.  Select the condition(s) from earlier questions

### 🟦 For Sections

1.  In **Step 2**, click the **gear icon ⚙️** on a section
2.  Check `**Show this section conditionally**`
3.  Choose whether to apply **AND** or **OR** logic
4.  Set your condition(s)

* * *

## 🔣 Supported Logic Operators

| Operator | Meaning |
| --- | --- |
| **Equals** | Matches an exact answer |
| **Does Not Equal** | Hides content if value matches |
| **Contains** | Works for multi-select fields |
| **Does Not Contain** | Useful for excluding values |

You can apply these based on:

-   Yes/No responses
-   Multiple choice selections
-   Text input (in limited cases)

* * *

## 🤖 AND vs. OR Logic

### ✅ **AND**: All conditions must be true

> e.g., Show "Injury Details" only if:
> 
> “Was there an incident?” = Yes
> 
> **AND** “Was anyone injured?” = Yes

### ✅ **OR**: Any one condition is true

> e.g., Show “Follow-up Required?” if:
> 
> “Safety Violation?” = Yes
> 
> **OR** “Inspection Failed?” = Yes

* * *

## 🧠 Use Case Examples

| Scenario | Logic |
| --- | --- |
| Show incident section only if an incident occurred | “Was there an incident?” = Yes |
| Reveal equipment notes if equipment is selected | “Equipment used?” ≠ None |
| Add supervisor sign-off only if job value > $10,000 | “Total project value” contains “10000” (if using numeric/text field) |

* * *

## 💡 Design Tips

-   Use conditional logic to keep forms short and context-aware
-   Don't overdo it—test combinations to avoid hiding required content by mistake
-   Combine logic with **permissions** and **collapsible sections** for maximum control

* * *

## 📌 Limitations

-   Conditional logic can only evaluate **previous** questions (not future ones)
-   If using external forms, data sources like projects or customers can’t be referenced
-   Complex multi-condition logic may require multiple layered rules or restructuring

* * *
