Preparation: Transforming Values Before Conditions

Created by Alexandru Sirbu, Modified on Tue, 17 Mar at 3:48 PM by Alexandru Sirbu

Each Preparation step selects a Domain and applies a formula to it. The result is written back into that Domain for the remainder of this Business Rule's execution - it does not modify the source data permanently. Preparation steps execute in order from top to bottom, and each step's output is immediately available to the next one. This means you can chain multiple transformations: for example, Trim a value to remove whitespace, then Upper it to normalise casing, and the condition that follows will see a clean, uppercase value.


Preparation results are also accessible in the rule's Conditions and Actions via the @ reference picker, just like any other Domain value. This makes it possible to use a computed or derived value on the left-hand side of a condition - something that cannot be achieved through conditions alone.


Adding a Preparation Step

  1. In the Business Rule form, locate the Preparation section. Click Add Step on the right side
  2. A new preparation item appears. Select the Domain you want to prepare from the dropdown on the left
  3. Click the Edit button (pencil icon) to open the Formula Editor for this step
  4. In the Formula Editor, select the operation from the first dropdown and configure the inputs in the fields to the right
  5. The dark preview area at the bottom shows the formula in Excel-like notation as you build it. Use this to verify the formula before closing
  6. Close the Formula Editor. The formula is now displayed on the preparation step
  7. Add further steps as needed by clicking Add Step again. Use the Copy button on any step to duplicate it as a starting point for a similar step. Use the Delete button to remove a step
Preparation is scoped to the individual Business Rule. The transformed values exist only for the duration of that rule's evaluation. If you want a prepared value to persist for downstream rules, write it to a Variable Domain using an Action - see Guide 5: Actions.



Available Operations by Data Type

The Formula Editor shows only operations relevant to the data type of the selected Domain.


String Operations

Operation

Description

String

Provides a string value - either a literal or a reference to another Domain or Data Link column.

Concat

Joins multiple strings together. An optional separator character can be specified between parts.

Lower

Converts the entire string to lowercase.

Upper

Converts the entire string to uppercase.

Trim

Removes whitespace. Choose Both (leading and trailing), Front (leading only), or End (trailing only).

Replace

Replaces all occurrences of a specified substring with another value.

Regex Replace

Applies a regular expression substitution. Capture groups are accessible in the Replace field as $1, $2, etc.

SubString

Extracts a portion of the string. Specify a zero-based start position and an optional length.

String from Date

Formats a Date Domain as a string using a specified date format pattern.

String from Number

Formats a Number Domain as a string using a specified number format.

String from Boolean

Converts a Boolean Domain to a string. Specify the text to use for true and false values.


Number Operations

Operation

Description

Number

Provides a number value - either a literal or a reference to a Domain or Data Link column.

Addition

Adds multiple numbers together.

Subtraction

Subtracts numbers in the order listed, top to bottom.

Multiplication

Multiplies multiple numbers together.

Division

Divides numbers in the order listed, top to bottom.

Round

Rounds to a specified number of decimal places. Choose Up, Down, or Commercial (standard) rounding.

Number from String

Parses a number from a string. Specify thousand and decimal separator characters if needed.

Number from Date

Returns the Unix Epoch seconds value of a Date Domain as a number.


Date Operations

Operation

Description

Date

Provides a date value from a Domain, Data Link column, or literal.

Add Time

Adds a specified time offset to a date value.

Date from String

Parses a date from a string using a specified format pattern.

Date from Number

Creates a date from a Unix Epoch seconds value.

Current Date

Returns a date relative to the current moment. Options: Now, Start of today, End of today, Start of current month, End of current month, Start of current year, End of current year.


Boolean Operations

Operation

Description

Date

Provides a date value from a Domain, Data Link column, or literal.

Add Time

Adds a specified time offset to a date value.

Date from String

Parses a date from a string using a specified format pattern.

Date from Number

Creates a date from a Unix Epoch seconds value.

Current Date

Returns a date relative to the current moment. Options: Now, Start of today, End of today, Start of current month, End of current month, Start of current year, End of current year.


Practical Examples


Normalising a country code before comparison: source data may contain 'de', 'DE', ' DE ', or 'Deutschland'. Add two steps: first Trim the Country Domain (removing spaces), then Upper it. The Condition 'Country equals DE' now reliably matches all four variants.


Computing an age from a birth date: use Number from Date to get the Unix epoch of the BirthDate Domain, then Subtraction and Division to compute approximate age in years. Store the result in a Variable Domain called VAR_Age and use it in a Condition 'VAR_Age is greater than or equal to 18'.


Extracting a year from an invoice reference string: use SubString with a zero-based start position and length of 4 to extract the year portion from a string like 'INV-2024-00123'. Store the result in a Variable Domain and compare it in a Condition.


If you have any further questions, please feel free to Contact Us.

You can also refer to the HEDDA.IO End User Documentation.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article