> For the complete documentation index, see [llms.txt](https://help.sdocs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sdocs.com/sdocs/advanced-template-logic/conditional-logic.md).

# Use Conditional Logic

Learn how to control template output with RENDER statements. Start with the tutorial, move to task-based guidance, then use the reference pages for syntax and examples.

Use this section when you need to control template output with `RENDER` statements.

Conditional logic lets you show or hide text, clauses, and sections based on Salesforce data.

Use it when one template needs to adapt to record values instead of branching into multiple template versions.

{% hint style="info" %}
Start with the tutorial if you are new to `RENDER`. Use the how-to guide for common build patterns. Use the reference when you need exact syntax, operators, and structure.
{% endhint %}

### Start with the path that fits your goal

If you are learning conditional logic for the first time, start with the Quick Start tutorial.

If you already know the output you need, jump to the how-to guide.

If you need exact behavior details, use the Developer's Hub reference.

<table data-column-title-hidden data-view="cards"><thead><tr><th>Title</th><th>Description</th><th data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Conditional Logic Tutorial</strong></td><td>Learn the core render pattern, null checks, AND and OR logic, and common starter examples.</td><td><a href="/quick-start/template-building/conditional-logic-tutorial.md">How to Show or Hide Content Automatically</a></td></tr><tr><td><strong>Conditional Logic (How-to)</strong></td><td>Jump to task-based guidance for render syntax, nesting, and common template use cases.</td><td><a href="/sdocs/advanced-template-logic/conditional-logic/conditional-logic-how-to.md">Quick Setup: Conditional Logic</a></td></tr><tr><td><strong>Conditional Logic Reference</strong></td><td>Use the reference for exact operators, syntax rules, and structural details.</td><td><a href="/developer-hub/template-configuration-and-styling/conditional-logic-reference.md">Conditional Logic Reference</a></td></tr></tbody></table>

### What you can do with conditional logic

* show or hide sections based on field values
* combine equality, null, AND, OR, and contains checks
* nest conditions when output depends on earlier logic
* keep one template flexible across multiple record states

### Browse by topic

* [Conditional Logic (How-to)](/sdocs/advanced-template-logic/conditional-logic/conditional-logic-how-to.md)
* [Handle Escaped Characters in RENDER Statements](/sdocs/advanced-template-logic/conditional-logic/handle-escaped-characters-in-render-statements.md)
* [How to Conditionally Show/Hide Table Columns](/sdocs/advanced-template-logic/template-attributes/template-attributes-how-to-guides/how-to-conditionally-show-hide-table-columns.md)
* [How to Display Different Values Based on Conditions](/sdocs/advanced-template-logic/template-attributes/template-attributes-how-to-guides/how-to-display-different-values-based-on-conditions.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.sdocs.com/sdocs/advanced-template-logic/conditional-logic.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
