isTruthy and isFalsey
isTruthy and isFalsey are Viewer conditional helpers for controlling content visibility.
Use them when you want to show or hide sections in your documents based on whether a Salesforce field has a value or is empty. Perfect for optional document sections, placeholder text, and conditional content blocks.
Function name meaning (quick reference)
isTruthy= value exists / has meaningful contentisFalsey= value is empty / missing
isTruthy
Shows a block when the value is considered truthy.
When to use: Display a section only if a field has data.
Scenario: Show account name only when it exists.
{{#isTruthy Account.Name}}
Account has a name: {{Account.Name}}
{{else}}
Account name is missing
{{/isTruthy}}
isFalsey
Shows a block when the value is considered falsey.
When to use: Display a fallback message when a field is empty.
Scenario: Show a missing-phone message when no phone value exists.
{{#isFalsey Account.Phone}}
Phone is empty or missing
{{else}}
Phone: {{Account.Phone}}
{{/isFalsey}}
Show/Hide a full section (table placeholder)
Use one condition block around the entire section.
{{#isTruthy Invoice.Items}}
## Invoice Items
<!-- Insert table here -->
{{else}}
No invoice items to display.
{{/isTruthy}}
This keeps output clean by hiding the full section when data is not available.
Opportunity Products example
{{#isTruthy Opportunity.Products}}
## Opportunity Products
<!-- Insert Opportunity Products table here -->
{{else}}
No Opportunity Products found.
{{/isTruthy}}
You can invert this with isFalsey when you prefer to start with a "missing data" message.
Typical falsey values
Common values treated as falsey:
falsenullundefined0""(empty string)NaN
Practical field examples
{{#isTruthy Opportunity.Amount}}
Amount: {{Opportunity.Amount}}
{{else}}
No amount was provided
{{/isTruthy}}
{{#isFalsey Opportunity.CloseDate}}
Close date is not set
{{/isFalsey}}
isTruthy / isFalsey tips
- Use
isTruthyto show a section only when data exists. - Use
isFalseyto show fallback text when data is missing. - Wrap full sections (like a table area) in one condition block.
- Keep only one business rule per block so the output stays predictable.
Common Use Cases
How do I show content only when a field has a value?
Use isTruthy to check if a field exists:
How do I display a fallback message when a field is empty?
Use isFalsey to show placeholder text:
How do I conditionally show an entire table section?
Wrap the whole section in one condition block:
How do I show a message for fields that might be null or empty?
Use isFalsey to catch missing data: