Variables

Purpose

Variables act as placeholders for data that is provided when a Smartform is created, typically via API or Workflow. These variables make external data available inside the Smartform and allow you to:

  • Use incoming data values inside rules
  • Control Show/Hide logic dynamically
  • Transform or map data before it is used in the form
  • Apply conditional behavior based on provided values

Common examples of variable data include:

  • Name
  • Age
  • Address
  • Identifiers
  • Lists or tables of objects

Variables are tightly connected to DataTable values, which are passed into the Smartform during creation.


How Variables Work

When a Smartform is created through:

  • API
  • Workflow

you can pass a set of DataTable values. Each value is identified by a key.

Variables defined in the Rules → Variables section correspond directly to these keys.
If a variable exists in the Smartform, its value will be populated automatically when the form is created.

Variables can then be:

  • Referenced in Data Transformation rules
  • Used in Show/Hide rules
  • Used in Page Templates

Variable Types

Each variable must have a defined type. Supported types are:

  • Text – String values such as names, addresses, or identifiers
  • Number – Numeric values such as age, amounts, or counters
  • Boolean – True/false values
  • Table (Array) – Collections of objects or rows (e.g. lists of people, items, or records)

The selected type determines how the variable can be used in rules and transformations.


Creating a Variable

Step-by-step

  1. Open the Smartform in Studio
  2. Navigate to Rules
  3. Select the Variables tab
  4. Enter a Variable Name
    • This must match the DataTable key provided by API or Workflow
    • Example: firstName, age, peopleList
  5. Select a Type
  6. (Optional) Set a Default Value
    • Used as fallback or test data
  7. Click Add Variable

The variable is now available for use in all rule types.


Default Values and Testing

Default values serve two purposes:

  • Provide fallback values if no data is passed
  • Act as test data when working in Studio or Test Runner

This allows you to design and test rules without requiring a live API or Workflow trigger.


Using Variables in Rules

Once created, variables can be referenced across the Rules system:

  • Data Transformation
    Transform or map incoming values before they are used in the form

  • Show/Hide
    Conditionally display fields or sections based on variable content

  • Page Templates
    Control page layout or content dynamically

Variables enable Smartforms to adapt to different contexts and data sets without requiring multiple form versions.


Typical Use Case Example

A Smartform is created for contract signing via API:

  • API sends:
    • firstName
    • age
    • address
  • Variables are defined with matching names
  • Rules are added:
    • Show additional consent if age < 25
    • Hide address section if address is empty
    • Transform incoming lists into table components

This makes the Smartform fully dynamic and data-driven.


Limitations and Notes

  • Variable names must match DataTable keys exactly
  • Variables do not store data permanently; values are resolved at form creation
  • Table (Array) variables require consistent object structure for reliable rule usage

Variables form the foundation of the Rules system and are required for most advanced Smartform logic. Subsequent rule types build on top of the variable definitions.