Skip to main content
Define your own computed field method using JsonLogic. For example, return the sum of two fields, map arrays, or return a boolean indicating if a field’s output is non-null.

Parameters

The following parameters are in the computed field’s global Method parameter:

Sensible operations

Sensible extends JsonLogic with the following operations:

Exists

JSON
Most commonly used with the JsonLogic var operation to test that an output value isn’t null. The var operation retrieves extracted field values using field id keys.

Match

JSON
Where regex is a Javascript-flavored regular expression. Double escape special regex characters, since the regex is in a JSON object (for example, \\s, not \s , to represent a whitespace character). This operation does not support regular expression flags such as i for case insensitive.

Replace

One of the following syntaxes:
JSON
Or:
JSON
Where regex is a Javascript-flavored regular expression. Double escape special regex characters, since the regex is in a JSON object (for example, \\s, not \s , to represent a whitespace character). This operation supports:
  • regex capturing groups
  • regex flags, such as i for case insensitive.

Examples

Example 1

The following example shows defining custom computed fields. Config
JSON
Example document
The following image shows the example document used with this example config:
Click to enlarge Output
JSON

Example 2

The following example shows using the Custom Computation method to perform the following operations on data extracted from an claims loss run insurance document:
  • Get the total number of claims listed in the document
  • Redact the claim IDs
  • Sum up the incurred cost for all claims listed
Config
JSON
Example document
The following image shows the example document used with this example config:
Click to enlarge Output
JSON