---
updatedAt: 2026-09-08T19:09:07.000Z
agentTools:
  projectIndex: https://docs.sensible.so/llms.txt
---

# Custom computation group

Learn how to use the Custom Computation Group method with JsonLogic to transform extracted document data and return multiple computed fields.

Define your own [computed field method](https://docs.sensible.so/docs/computed-field-methods) to transform extracted document data using [JsonLogic](https://docs.sensible.so/docs/jsonlogic). Can return multiple fields.

# Parameters

The following parameters are in the computed field's [global Method](https://docs.sensible.so/docs/computed-field-methods#parameters) parameter:

| key                      | value                    | description                                                                                                                                                    |
| :----------------------- | :----------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id (**required**)        | `customComputationGroup` | This method has access to the  `parsed_document` object at [verbosity](https://docs.sensible.so/docs/verbosity) = 0.                                                                     |
| jsonLogic (**required**) | JsonLogic object         | A [JsonLogic rule](https://docs.sensible.so/docs/jsonlogic) that transforms the output of [Field objects](https://docs.sensible.so/docs/field-query-object) and outputs multiple fields. |

# Examples

The following example shows using the Custom Computation Group method in combination with the Pick Values operator to copy fields from the parent `fields` object into sections.

**Config**

```json
{
  "fields": [
    {
      /* capture raw policy # to copy into 
      each claim  */
      "id": "_raw_policy_number",
      "type": "number",
      "anchor": "policy number",
      "method": {
        "id": "label",
        "position": "right"
      }
    },
    {
      /* capture raw policy name to copy into 
      each claim  */
      "id": "_raw_policy_name",
      "anchor": "policy name",
      "method": {
        "id": "row",
      }
    },
    /*    each claim starts with "claim number" and ends with 
     "Date of claim" */
    {
      "id": "claims_sections",
      "type": "sections",
      "range": {
        "anchor": {
          "match": {
            "type": "includes",
            "text": "claim number"
          },
        },
        "stop": {
          "type": "includes",
          "text": "Date of claim",
          "isCaseSensitive": true
        }
      },
      /* return each claim as object containing claim # 
      and other fields */
      "fields": [
        {
          "id": "claim_number",
          "type": "number",
          "anchor": {
            "match": {
              "type": "startsWith",
              "text": "Claim number:",
              "isCaseSensitive": true
            }
          },
          "method": {
            "id": "label",
            "position": "right"
          }
        },
        
        /* to access the `_raw_policy_number` field from
          inside the `claims_sections field`, use
          ../../ syntax to traverse levels of scope in the
          JSON output. e.g., use
          ../_raw_policy_name since it's in a parent array
          */
        /* as an alternative to this syntax, see the copy_to_section method */
        
        {
          "method": {
            /* use the custom computation group to output multiple fields */
            "id": "customComputationGroup",
            "jsonLogic": {
              /* copies the specified fields from the parent object
                 to each section */
              "pick_fields": [
                {
                  "var": "../"
                },
                [
                  "_raw_policy_number",
                  "_raw_policy_name"
                ]
              ]
              }
            }
          }
    
        ]
    }
    ]
  }
```

**Example document**<br />The following image shows the example document used with this example config:

![Click to enlarge](https://raw.githubusercontent.com/sensible-hq/sensible-docs/v0/assets/images/final/copy_to_section.png)

| Example document | [Download link](https://raw.githubusercontent.com/sensible-hq/sensible-docs/v0/assets/pdfs/sections.pdf) |
| ---------------- | -------------------------------------------------------------------------------------------------------- |

**Output**

```json
{
  "_raw_policy_number": {
    "source": "5501234567",
    "value": 5501234567,
    "type": "number"
  },
  "_raw_policy_name": {
    "type": "string",
    "value": "National Landscaping Solutions"
  },
  "claims_sections": [
    {
      "claim_number": {
        "source": "1223456789",
        "value": 1223456789,
        "type": "number"
      },
      "_raw_policy_number": {
        "source": "5501234567",
        "value": 5501234567,
        "type": "number"
      },
      "_raw_policy_name": {
        "type": "string",
        "value": "National Landscaping Solutions"
      }
    },
    {
      "claim_number": {
        "source": "9876543211",
        "value": 9876543211,
        "type": "number"
      },
      "_raw_policy_number": {
        "source": "5501234567",
        "value": 5501234567,
        "type": "number"
      },
      "_raw_policy_name": {
        "type": "string",
        "value": "National Landscaping Solutions"
      }
    },
    {
      "claim_number": {
        "source": "6785439210",
        "value": 6785439210,
        "type": "number"
      },
      "_raw_policy_number": {
        "source": "5501234567",
        "value": 5501234567,
        "type": "number"
      },
      "_raw_policy_name": {
        "type": "string",
        "value": "National Landscaping Solutions"
      }
    },
    {
      "claim_number": {
        "source": "7235439210",
        "value": 7235439210,
        "type": "number"
      },
      "_raw_policy_number": {
        "source": "5501234567",
        "value": 5501234567,
        "type": "number"
      },
      "_raw_policy_name": {
        "type": "string",
        "value": "National Landscaping Solutions"
      }
    },
    {
      "claim_number": {
        "source": "8235439211",
        "value": 8235439211,
        "type": "number"
      },
      "_raw_policy_number": {
        "source": "5501234567",
        "value": 5501234567,
        "type": "number"
      },
      "_raw_policy_name": {
        "type": "string",
        "value": "National Landscaping Solutions"
      }
    }
  ]
}
```