Skip to main content

Conditions

Time to learn: 10 minutes
Prerequisites: Understanding of Placeholders

Conditions are "if-then" rules that control when placeholders and sections appear in your documents. They let you show or hide content based on your data.

🔀

Conditions Quick Reference

What it doesShow/hide content based on rules
Where to usePlaceholders or Sections
InterfaceVisual query builder
OperatorsEquals, Contains, >, <, etc.

What Are Conditions?​

Conditions let you create rules like:

  • "If customer is VIP, show special discount message"
  • "If status is approved, show approval notice"
  • "If amount is over $1000, show premium features"

Think of them like IF statements in spreadsheets - if a condition is true, show the content; if false, hide it.

Decision Tree: When to Use Conditions​

Why Use Conditions?​

Conditions let you:

  • Personalize content based on data values
  • Create dynamic documents that adapt to each record
  • Reduce template complexity by using one template for multiple scenarios
  • Show relevant information only when it applies

How Conditions Work​

When Gdocify generates a document:

  1. It evaluates the condition using data from your record
  2. If the condition is true, the content is shown
  3. If the condition is false, the content is hidden (or deleted)

Setting Up Conditions​

For Placeholders​

  1. Open the Mapping Config overlay
  2. Find the placeholder you want to conditionally show
  3. Expand Advanced Settings
  4. Enable Conditions
  5. Build your rule using the query builder
  6. Choose the action: Show or Hide

For Sections​

  1. Open the Mapping Config overlay
  2. Go to the Sections tab
  3. Find or create your section
  4. Set the action: Show or Hide
  5. Build your condition rule

Visual Query Builder​

Gdocify provides an easy-to-use visual query builder - no coding required!

Building a Condition​

  1. Select a field from your data source
  2. Choose an operator (equals, contains, greater than, etc.)
  3. Enter a value to compare against
  4. Add more conditions with AND/OR if needed

Available Operators​

  • Equals (=) - Exact match
  • Not equals (!=) - Not an exact match
  • Contains - Field contains the value
  • Doesn't contain - Field doesn't contain the value
  • Begins with - Field starts with the value
  • Ends with - Field ends with the value
  • Greater than (>) - Numeric comparison
  • Less than (<) - Numeric comparison
  • Greater than or equal (>=) - Numeric comparison
  • Less than or equal (<=) - Numeric comparison
  • Is empty - Field has no value
  • Is not empty - Field has a value
  • In - Field value is in a list
  • Between - Field value is between two values

Combining Conditions​

You can create complex rules by combining conditions:

AND Logic​

All conditions must be true:

  • "Status is 'Active' AND Amount is greater than 1000"

OR Logic​

Any condition can be true:

  • "Status is 'VIP' OR Status is 'Premium'"

Mixed Logic​

Combine AND and OR:

  • "(Status is 'Active' OR Status is 'Pending') AND Amount > 100"

Use Cases​

Show Premium Features​

Only show premium features for premium customers:

  • Condition: customerType equals "Premium"
  • Action: Show placeholder {{premiumFeatures}}

Conditional Messages​

Show different messages based on status:

  • Condition: status equals "Approved"
  • Action: Show placeholder {{approvalMessage}}
  • Condition: status equals "Pending"
  • Action: Show placeholder {{pendingMessage}}

Hide Irrelevant Sections​

Hide sections that don't apply:

  • Condition: hasDiscount equals "Yes"
  • Action: Show section "Discount Details"
  • Condition: hasDiscount equals "No"
  • Action: Hide section "Discount Details"

Delete Paragraph Option​

When hiding a placeholder, you can choose to:

  • Hide placeholder only: The placeholder disappears, but the paragraph remains
  • Delete entire paragraph: Remove the whole paragraph containing the placeholder

Use "Delete paragraph" when:

  • The paragraph only contains the conditional content
  • You want a cleaner document when content is hidden
  • The paragraph doesn't make sense without the placeholder

Practical Examples​

Example 1: VIP Customer Discount​

Condition:

  • Field: customerType
  • Operator: Equals
  • Value: "VIP"

Action: Show placeholder {{vipDiscount}}

Result: Only VIP customers see the discount message.

Example 2: Approval Status​

Condition:

  • Field: status
  • Operator: Equals
  • Value: "Approved"

Action: Show placeholder {{approvalStamp}}

Result: Approved records show an approval stamp.

Example 3: High-Value Orders​

Condition:

  • Field: orderAmount
  • Operator: Greater than
  • Value: 1000

Action: Show section "Premium Service Details"

Result: Only orders over $1000 show premium service information.

Best Practices​

  • Test conditions carefully: Make sure conditions work as expected
  • Use clear field names: Makes building conditions easier
  • Document your conditions: Note why each condition exists
  • Start simple: Begin with basic conditions, add complexity gradually
  • Test edge cases: What happens with empty values? Null values?

Common Mistakes​

  • Wrong operator: Using "equals" when you need "contains"
  • Case sensitivity: "VIP" is different from "vip"
  • Empty values: Conditions with empty fields may not work as expected
  • Complex logic: Over-complicating conditions when simple ones work

Tips​

  • Use the query builder: It's visual and easy to use
  • Test with sample data: Verify conditions work before generating many documents
  • Combine with sections: Use conditions on sections for more control
  • Keep it simple: Simple conditions are easier to maintain

Next Steps​

Now that you understand conditions:

  1. Learn about Sections for conditional content blocks
  2. Explore Placeholders for basic data insertion
  3. Check out Use Case Examples for real-world scenarios