Add computed fields
Enables transforming a table by adding an array of computed fields that operate on the extracted table. For example, you can add text to each cell in a row, concatenate columns, add or remove columns, and so forth. This method is similar to adding a computed fields array to sections. In detail, this method:
- Automatically zips the source table. After the zip, each table cell is a field whose ID is the column heading. Note that zipped tables have the same JSON output structure as sections. This enables you to use section-specific computed fields to transform the table, such as the Copy To Section method.
- Operates on the fields in the table using the array of computed fields you specify.
Parameters
The following parameters are in the computed field’s global Method parameter:
key | value | description |
---|---|---|
id (required) | addComputedFields | |
source_id (required) | source field ID in the current config | The ID of the table you want to transform. To transform fields in a section, add a computed fields array to sections. |
fields | array of computed fields | Specifies to output computed fields in the new table. The computed fields have access to the source table’s fields. To get access to and transform the output of fields that aren’t in the source table, use the Copy to section method. |
Examples
The following example shows how to transform extracted tables so they’re consistent across different document formats.
In the following example, Insurer A excludes the vehicle VIN and model from their policy limits table. In contrast, Insurer B includes the vehicle VIN, model, and make in their limits table:
This example uses the Add Computed Fields method to ensure that each table contains the same field IDs (vin
, policy_start
, limits
, amount
, and model
):
To ensure consistency, this example transforms the tables as follows:
- for Insurer A, copies vehicle details into the table
- for Insurer B, removes the vehicle make
Config
Example document
The following image shows the example document used with this example config:
Example document | Download link |
---|
Output