For the complete documentation index, see llms.txt. This page is also available as Markdown.

Quick Setup: Conditional Logic

Using S-Docs Render Statements

This is the main way to include or exclude sections of a document based on logic within the template itself. It does not require creating new Salesforce fields.

Basic structure

<!--RENDER=logical_expression -->
  content to show if expression is true
<!--ENDRENDER-->

The engine evaluates logical_expression; if TRUE, everything up to ENDRENDER appears in the final document.

If you are interested, please check out my working examples article for quick reference!


AND / OR Logic Structure

AND

<!--RENDER=(logical_expression-1 && logical_expression-2) -->
  content to show if expression is true
<!--ENDRENDER-->

OR

<!--RENDER=(logical_expression-1 || logical_expression-2) -->
  content to show if expression is true
<!--ENDRENDER-->
  • The expressions need to be contained within parenthesis.

  • && or || are important to use.


Nested Conditional Logic

You can nest up to 4 levels deep. This lets you represent dependent conditions—for example, missing phone and alternate numbers:

A few requirements: ✔ Each nested level must use a distinct render tag (RENDER1, RENDER2, etc.) ✔ Tags must be properly paired ✔ No skipping levels (i.e., RENDER2 must be inside RENDER1)


CONTAINS & NOT CONTAINS

If you want to check if a field contains a substring:

And the opposite:

This is helpful when looking for keywords or partial matches in text fields.


When You Should (and Shouldn’t) Use Template Logic

Best For

✅ Dynamic document content that varies by prefix, status, tier, field values, etc. ✅ Avoiding dozens of separate templates ✅ Complex visibility logic embedded in template

Less Ideal For

❌ Extremely large text blocks controlled by simple rules — consider formula fields ❌ Logic that already exists elsewhere in your Salesforce processes

Pro Tips

Last updated

Was this helpful?