Viewer Comparison Helpers
This page shows common comparison helpers you can use in Viewer templates for conditional logic and dynamic content.
Use these helpers to control what sections are shown in your documents based on Salesforce field values. Show or hide content based on field comparisons, status checks, or complex logical conditions.
Function name meaning (quick reference)
eq= equalis= is equal toneq= not equalgt= greater thangte= greater than or equallt= less thanlte= less than or equaland= all conditions must be trueor= at least one condition is truenot= reverse/invert the condition
eq
Checks if two values are equal.
Use it when you want to render content only for one exact value.
Scenario: Show a different section for customer vs non-customer accounts.
is
is is commonly used as an alias for equality checks (same idea as eq).
Scenario: Render a checklist only when the opportunity is in Proposal stage.
neq
Checks if two values are not equal.
Use it when a section should appear for every value except one.
Scenario: Show next steps unless the opportunity is already closed won.
gt
Checks if the first value is greater than the second value.
Scenario: Highlight high-value opportunities above 10,000.
gte
Checks if the first value is greater than or equal to the second value.
Scenario: Trigger manager approval for amounts starting at 50,000.
lt
Checks if the first value is less than the second value.
Scenario: Show a risk warning when probability is below 30.
lte
Checks if the first value is less than or equal to the second value.
Scenario: Apply standard discount text for discounts up to 10.
and
Checks that all provided conditions are true.
Use it when multiple business rules must pass together.
Scenario: Show approval flow only when amount is high and stage is Proposal.
or
Checks that at least one provided condition is true.
Scenario: Show sales-motion content for New Business or Upsell.
not
Negates a condition (true becomes false, false becomes true).
Scenario: Render active-opportunity content when stage is not Closed Lost.
Opportunity products example
Use comparison helpers to show/hide details by quantity and price:
Combining conditions
Quick helper selection guide
- Use
eq/isfor exact value matching. - Use
neqfor "anything except this value". - Use
gt,gte,lt,ltefor number-based rules. - Use
and,or,notto combine or invert conditions.
Common Use Cases
How do I show content only for a specific stage?
Use the eq helper to match an exact value:
How do I hide a section for a specific status?
Use the neq helper to exclude one value:
How do I apply rules based on an amount threshold?
Use gte or lte for amount-based logic:
How do I combine multiple conditions (AND logic)?
Use and when all conditions must be true:
How do I show content if ANY condition is true (OR logic)?
Use or for multiple acceptable values:
How do I invert a condition?
Use not to reverse the logic:
Comparison helper tips
- Keep each condition tied to one clear business rule.
- Prefer explicit thresholds (for example
10000,50000) instead of vague checks. - Use
and/oronly when combining rules is truly required. - Add fallback text when a condition may hide important content.