Crove Docs
Crove Docs
Crove Documentation

Getting Started

IntroductionQuick StartKey Concepts

Templates

Templates OverviewTemplate EditorVariablesExpressionsForm Builder

Documents

Documents OverviewCreating DocumentsFilling DocumentsE-SignaturesPDF Generation

API Reference

API OverviewAuthenticationTemplates APIDocuments APIRate Limits

Webhooks

Webhooks OverviewOutgoing WebhooksIncoming WebhooksWebhook Events

Integrations

Integrations OverviewZapier IntegrationAPI Keys

Account & Billing

Account OverviewTeam ManagementBilling & PlansWorkspace Settings

Expressions

Create computed fields and conditional logic with JEXL expressions in Crove templates.

Expressions

Expressions let you create computed fields and conditional logic in your templates using JEXL (JavaScript Expression Language). They evaluate automatically when form data changes.

Expression types

Computed fields

Computed expressions calculate a value from other variables. The result is displayed in the document and optionally in the form.

Examples:

// Calculate total from quantity and price
quantity * unitPrice

// Calculate tax (20%)
subtotal * 0.2

// Grand total
subtotal + tax

// Concatenate strings
firstName + " " + lastName

// Conditional text
contractType == "Annual" ? "12 months" : "Month-to-month"

Conditions

Condition expressions evaluate to true or false. They control visibility of form fields and document sections.

Examples:

// Show field when account type is Business
accountType == "Business"

// Show discount section when amount exceeds threshold
orderTotal > 1000

// Show international fields when country is not US
country != "United States"

// Combine conditions
age >= 18 && hasConsent == true

Creating an expression

  1. Open the template editor
  2. Go to the Variables panel
  3. Click Add Expression
  4. Enter a name (e.g., "Total Amount")
  5. Choose the type: Computed or Condition
  6. Write the JEXL expression
  7. The expression is evaluated in real-time as form data changes

JEXL syntax reference

Operators

OperatorDescriptionExample
+Addition / concatenationprice + tax, first + " " + last
-Subtractiontotal - discount
*Multiplicationquantity * price
/Divisiontotal / count
%Modulovalue % 2
==Equalstatus == "active"
!=Not equalcountry != "US"
>Greater thanamount > 1000
>=Greater than or equalage >= 18
<Less thanquantity < 10
<=Less than or equalscore <= 100
&&Logical ANDage >= 18 && consent
||Logical ORisAdmin || isOwner
!Logical NOT!isExpired

Ternary operator

Use the ternary operator for inline conditionals:

// condition ? valueIfTrue : valueIfFalse
plan == "Pro" ? "Priority Support" : "Standard Support"

Referencing variables

Reference variables by their ID in expressions. The variable picker shows available variables when writing an expression.

// Simple reference
clientName

// Arithmetic with variables
unitPrice * quantity

// String operations
"Dear " + clientName + ","

Conditional visibility

Use condition expressions to show or hide form fields and document sections dynamically.

Field visibility

Attach a condition to any form field to show/hide it based on other field values:

  1. Select a form field in the form builder
  2. Set the Visible when property to a condition expression
  3. The field only appears when the condition is true

Example:

  • Field: "Company Name"
  • Visible when: accountType == "Business"
  • Result: The "Company Name" field only shows when the user selects "Business" as account type

Document sections

Conditional sections in the document template show or hide entire blocks of content:

  • Wrap content in a conditional container
  • Assign an expression to the container
  • The content renders only when the expression evaluates to true

Common patterns

Invoice calculations

// Line item total
quantity * unitPrice

// Subtotal (sum of line items)
item1Total + item2Total + item3Total

// Tax calculation
subtotal * taxRate / 100

// Grand total
subtotal + taxAmount

// Discount
subtotal > 5000 ? subtotal * 0.1 : 0

Conditional content

// Show warranty section for hardware products
productCategory == "Hardware"

// Show international shipping fields
shippingCountry != "United States" && shippingCountry != "Canada"

// Show signature block only when terms are accepted
termsAccepted == true

Dynamic text

// Pronoun based on selection
gender == "Male" ? "he" : gender == "Female" ? "she" : "they"

// Plural handling
quantity == 1 ? "item" : "items"

// Full address
streetAddress + ", " + city + ", " + state + " " + zipCode

Best practices

  1. Keep expressions simple — Break complex calculations into multiple computed fields
  2. Name clearly — Use descriptive names like "Total with Tax" instead of "calc1"
  3. Test with edge cases — What happens when a referenced variable is empty?
  4. Use conditions sparingly — Too many conditional fields can confuse respondents
  5. Document your logic — Use the expression description field to explain complex formulas

Variables

Add dynamic content to your templates with variables — the building blocks of document automation.

Form Builder

Build smart data collection forms with 14+ field types, validation, and conditional logic.

On this page

ExpressionsExpression typesComputed fieldsConditionsCreating an expressionJEXL syntax referenceOperatorsTernary operatorReferencing variablesConditional visibilityField visibilityDocument sectionsCommon patternsInvoice calculationsConditional contentDynamic textBest practices