How to Replace Deprecated Extensions with Formula Fields in Rossum

Prev Next

With the introduction of Formula Fields, we’ve decided to phase out a few older extensions. If you’ve already set up these extensions, don’t worry - they’ll still work. But going forward, Formula Fields offer a more flexible and easier way to handle the same tasks. They also make it much simpler to adjust your logic whenever your needs change.

Rossum Extensions That Were Deprecated

Find & Replace Values Extension

  • What it did: Automatically cleaned or reformatted values.

  • Example use: Remove special characters from invoice numbers.

Value Mapping Extension

  • What it did: Matched specific values from your documents to custom, predefined ones.

  • Example use: Translate invoice payment terms like “Net 30” into internal codes like PAY_30.

Date Calculation Extension

  • What it did: Performed date math to calculate things like due dates or delivery windows.

  • Example use: Add 30 days to an invoice date to set the payment due date.

Numeric Calculations Extension

  • What it did: Handled basic math between numbers in your documents.

  • Example use: Calculate total price from quantity × unit price, or compute VAT.

Copy & Paste Values Extension

  • What it did: Copied values from one field to another automatically.

  • Example use: Copy the vendor address to another section of the document for reporting or export.

What Can Formula Fields Do?

Formula fields can now handle all the situations that old extensions (now deprecated) used to solve. If you want to switch from an extension to a formula field, the process is easy.

Example: Copy & Paste Value extension

Imagine that you have a value, let's say the issue date of the invoice, that should be in two separate fields - the Date Issue field  (ID: date_issue) and another field called Transaction Date (ID: date_transaction). In the past, Rossum recommended using the Copy & Paste Value extension for this.

How your old workflow looked:

  1. AI predicts the value in date_issue.

  2. The extension copies this value into date_transaction .

The workflow parts:

  1. date_issue → predicted by AI (captured field)

  2. date_transaction → value added by the extension (data field)

  3. Copy & Paste extension → takes the value from date_issue and copies it into date_transaction

Replacing the extension with a Formula Field

You can replace this with a formula field in just a few steps:

  1. Go to Queue Settings.

  2. Add a new formula field for transaction date (see the guide - LINK).

  3. The formula field is a new field in your schema, so it needs a different ID from the old data field. The label can stay the same or be different, but we recommend making it different so you can identify the field more easily.

  4. In natural language, tell the formula field: “Copy value that was predicted in Issue Date field.” The formula field will automatically create the right formula for you.

  5. Save new field.

Things to remember when switching

  1. If you don’t want to lose old data, you can hide the old field where the extension was adding values - just don’t delete it.

  2. Once the formula field is active, you can disable the extension.

  3. If you use the value from the Transaction Date field in other workflows, remember to update its ID to the ID of your new formula field.

Syntax examples per extension

Find & Replace Values Extension

Reference article HERE

{
      "transformations": [
        {
          "pattern_to_replace": "[^a-zA-Z\\d]",
          "value_to_replace_with": "",
          "replace_if_this_pattern_matches": "[^a-zA-Z\\d]"
        }
      ],
      "source_target_mappings": [
        {
          "source": "sender_vat_id",
          "target": "sender_vat_id_normalized"
        },
        {
          "source": "iban",
          "target": "iban_normalized"
        }
      ]
    }

The pseudo code:

for source, target in {config.source_target_mappings}:
  if re.match({config.replace_if_this_pattern_matches}, source):
    target.write(re.sub({config.pattern_to_replace}, {value_to_replace_with}, source))
  else:
    target.write(source)

In this case there’re 2 targets (sender_vat_id_normalized, iban_normalized) with same code except source_field:

source_field = field.sender_vat_id
pattern_to_replace = "[^a-zA-Z\\d]"
replace_if_this_pattern_matches = "[^a-zA-Z\\d]"
value_to_replace_with = ""

if re.match(replace_if_this_pattern_matches, source_field):
    re.sub(pattern_to_replace, value_to_replace_with, source_field)
else:
    source_field

Date Calculation Extension

Reference article HERE

{
      "condition": "{sender_name} == 'Milk Company'",
      "expression": "today() + timedelta(weeks=4)",
      "target_field": "date_due_calculated"
}

Similar to previous but the result should be datetime type:

if field.sender_name == 'Milk Company':
    datetime.datetime.today() + timedelta(weeks=4)

Numeric Calculations Extension

Reference article HERE

Configuration has syntax:

   {
      "expression": "{item_total_base} / {item_amount_base}",
      "target_field": "item_quantity_calculated",
      "result_decimal_points": 2,
      "condition": "{sender_name} == 'Polychemtex Inc.'"
    }

In pseudo code it will be something like:

if {condition}:
  round({expression}, {result_decimal_points, default=2})

The FF will looks like:

if field.sender_name == 'Polychemtex Inc.':
    result = default_to(field.item_total_base, 0) / default_to(field.item_amount_base, 1)
    round(result, 2)

Copy & Paste Values Extension

Reference article HERE

Here we have more configuration options, for example:

    {
      "source_field": "iban_calculated",
      "target_field": "iban_calculated_ii",
      "value_conversion": "upper",
      "condition": "{sender_name} == 'Polychemtex Inc.'",
      "condition_false_source_field": "document_id",
    },

should be explained like (FF for iban_calculated):

if field.sender_name == 'Polychemtex Inc.':
  field.iban_calculated.upper()
else:
  field.document_id

Another example:

    {
      "source_field": "document_type",
      "target_field": "document_type_code_calculated",
      "values_mapping": {
        "tax_invoice": "10",
        "credit_note": "20",
        "proforma": "30",
        "debit_note": "40",
        "receipt": "50"
      }
    },

and it’s representation in FF:

values_mapping = {
  "tax_invoice": "10",
  "credit_note": "20",
  "proforma": "30",
  "debit_note": "40",
  "receipt": "50"
}
if field.document_type in values_mapping:
    values_mapping[field.document_type]
else:
    raise Exception("Invalid configuration")