> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# FetchingCapturedData activity for a single-document case

> Set up the FetchingCapturedData Pega activity for a single-document case to call ABBYY FlexiCapture for the captured JSON and apply the data transform.

The `FetchingCapturedData` activity retrieves the captured data from ABBYY FlexiCapture as JSON and applies the data transform that maps it to the case fields.

For the general procedure, see [Create a Pega activity](/flexi-capture/connectors/pega/pega-activity-create).

## Pages and classes

| Page name | Class   |
| --------- | ------- |
| `Case`    | `Work-` |

## Parameters

| Name            | Data type | Required |
| --------------- | --------- | -------- |
| `CaseId`        | `String`  | Yes      |
| `jsonData`      | `String`  | No       |
| `executionMode` | `String`  | No       |

## Activity steps

<Steps>
  <Step title="Open the case">
    | Field              | Value                |
    | ------------------ | -------------------- |
    | **Method**         | `Obj-Open-By-Handle` |
    | **Step page**      | `Case`               |
    | **InstanceHandle** | `Param.CaseId`       |

    <Frame>
      <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega119.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=cc4fd913220489bd1eb8e02cbcc261a1" alt="Screenshot of the FetchingCapturedData activity in Pega, showing Step 1 with the Obj-Open-By-Handle method on the Case step page and InstanceHandle set to Param.CaseId." width="1122" height="331" data-path="images/flexi-capture/connectors/Pega119.png" />
    </Frame>
  </Step>

  <Step title="Fetch the captured data">
    Set **Method** to `Property-Set` and the properties as follows:

    | PropertiesName        | PropertiesValue                         |
    | --------------------- | --------------------------------------- |
    | `Param.jsonData`      | `@ABBYY.FetchingCapturedData(.BatchId)` |
    | `Param.executionMode` | `DESERIALIZE`                           |

    For more information, see [FetchingCapturedData](/flexi-capture/connectors/pega/pega-func-one-doc#fetchingcaptureddata).

    Add the following **Jump** condition, and set **On exception, jump to later step label** to `ERR`:

    | When             | if true            | true param | if false           | false param |
    | ---------------- | ------------------ | ---------- | ------------------ | ----------- |
    | `StepStatusFail` | Jump to Later Step | `ERR`      | Jump to Later Step | `OK`        |

    <Frame>
      <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega120.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=e97dbc72a5667595760607cc8da34084" alt="Screenshot of the FetchingCapturedData activity in Pega, showing Step 2 with the Property-Set method setting Param.jsonData to @ABBYY.FetchingCapturedData(.BatchId) and Param.executionMode to DESERIALIZE." width="1123" height="240" data-path="images/flexi-capture/connectors/Pega120.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega121.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=eb7140b9d8fe23a95fa01f458c4d0cee" alt="Screenshot of the Jump conditions dialog for Step 2 in Pega, showing the StepStatusFail condition jumping to label ERR if true and to label OK if false, with the on-exception label set to ERR." width="1021" height="298" data-path="images/flexi-capture/connectors/Pega121.png" />
    </Frame>
  </Step>

  <Step title="Post the error message">
    | Field       | Value                                        |
    | ----------- | -------------------------------------------- |
    | **Label**   | `ERR`                                        |
    | **Method**  | `Page-Set-Messages`                          |
    | **Message** | `@unescapeHTML(@getWorstMessageName(tools))` |

    For more information, see [unescapeHTML](/flexi-capture/connectors/pega/pega-func-other#unescapehtml).

    Add the following **Jump** condition:

    | When   | if true       | true param | if false | false param |
    | ------ | ------------- | ---------- | -------- | ----------- |
    | `true` | Exit Activity |            |          |             |

    <Frame>
      <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega122.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=3b441e05344815afc6aa9c1d8c3e8d6c" alt="Screenshot of the FetchingCapturedData activity in Pega, showing Step 3 labeled ERR with the Page-Set-Messages method and the Message parameter set to @unescapeHTML(@getWorstMessageName(tools))." width="869" height="190" data-path="images/flexi-capture/connectors/Pega122.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega123.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=d9e866ee0a04e7250377cad6d0546da7" alt="Screenshot of the Jump conditions dialog for Step 3 in Pega, showing a When condition of true set to Exit Activity." width="1000" height="296" data-path="images/flexi-capture/connectors/Pega123.png" />
    </Frame>
  </Step>

  <Step title="Apply the data transform">
    | Field                 | Value                                 |
    | --------------------- | ------------------------------------- |
    | **Label**             | `OK`                                  |
    | **Method**            | `Apply-DataTransform`                 |
    | **DataTransform**     | `JsonToInvoiceWithVerificationFields` |
    | **PassParameterPage** | `true`                                |

    For more information, see [Create the data transform for a single-document processing case](/flexi-capture/connectors/pega/pega-dt-one-doc).

    <Frame>
      <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega124.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=6ef1fadf242e41298a3d1a097c0efd45" alt="Screenshot of the FetchingCapturedData activity in Pega, showing Step 4 labeled OK with the Apply-DataTransform method, the DataTransform parameter set to JsonToInvoiceWithVerificationFields, and PassParameterPage selected." width="1116" height="203" data-path="images/flexi-capture/connectors/Pega124.png" />
    </Frame>
  </Step>
</Steps>
