Skip to main content

Best Practices for Creating Transformations

Practical guidelines for designing effective, maintainable Transformations that reliably reshape extracted data for downstream systems

Follow these guidelines to design effective Transformation Rules that reliably reshape extracted data for downstream systems.


When to Use

Refer to this guide before writing or reviewing Transformation Rules.


Prerequisites

  • Admin role in Docupath

  • Familiarity with Transformation Rules (condition operators, action operators, and scoping)


Key Practices

  1. Keep transformations simple and targeted. One rule per logical operation makes debugging and maintenance straightforward.

  2. Test on edge cases (empty values, unusual formats) before deploying to large-scale workflows.

  3. Use Transformations for formatting and reshaping only. Complex extraction logic belongs in Instruction Builds, not Transformations.

  4. Handle null values explicitly. SET a numeric default before applying arithmetic operations (INCREASE, DECREASE, MULTIPLY, DIVIDE) to avoid errors.

  5. Order actions carefully within a rule. Actions execute top-to-bottom; a later action may depend on the result of an earlier one.

  6. Use separate rules rather than complex compound logic. Multiple simple rules are easier to maintain than a single rule with deeply nested AND/OR conditions.

  7. Keep CSV lookup files up-to-date. Stale reference data causes silent validation failures.

  8. Reserve complex contextual logic for Instruction Builds. Transformations are best suited for deterministic, field-level operations.

  9. Regularly review rules to ensure they still match evolving business requirements.

  10. Document the purpose of each rule so future reviewers understand the business intent.


Common Issues

Issue

Cause

Resolution

Incorrect transformation output

Rule not tested with varied inputs

Test with multiple sample documents covering edge cases

Failures on empty or irregular values

Null and edge-case values not handled

Add explicit handling for empty and irregular values

Overcomplicated rules that are hard to maintain

Too much logic packed into a single rule

Break into smaller, single-purpose rules

Arithmetic errors on non-numeric fields

INCREASE/DECREASE/MULTIPLY/DIVIDE applied without a numeric default

SET a numeric default value before applying arithmetic actions

Did this answer your question?