Contact Us 1-800-596-4880

Creating Document Actions

A document action is a multi-step process that uses multiple AI engines to scan a document, filter out fields, and return a structured response as a JSON object. Each document action defines the types of documents it expects as input, the fields to extract, and the fields to filter out from the response. You can hide fields, mark fields as required, configure the minimum confidence score accepted for each field to extract, and configure Prompts to enhance and refine the data-extraction process by asking questions using natural language.

Create a document action using a predefined type as a template, and then specify which fields are mandatory, which fields to exclude from the JSON response, and the minimum confidence score expected for each field.

You can also extract specific data from a document using questions in natural language, for example:

  • What is the subtotal amount?

  • What is the grand total?

  • When is the due date?

  • What is the highest price?

After you create a new document action, you can add reviewers and publish it to Anypoint Exchange, which enables RPA to execute the document action and also creates an API that you can call from any external system.

When you create a document action, ensure that the configured schema works for each uploaded document. If you can’t customize the schema to work with all sample documents, consider creating multiple document actions. For example, purchase orders from multiple vendors might be different enough to require a separate document action for each vendor.

Creating a document action requires the following tasks:

Before You Begin

Ensure you have any of the following Anypoint permissions:

Manage Actions

Gives a user complete access to IDP and assigns reviewer permission by default for every document action.

Build Actions

Enables a user to create, edit, and publish document actions and assign reviewers to the actions.

Upload Sample Files and Preview the Results

To start creating a new document action, upload sample files to test the extraction process:

  1. In the sidebar, click Document Actions.

  2. Click Create New.

  3. Select the type of document to use as a template, specify a name for your document action, and click Create.

  4. Click Select files and upload sample files to analyze.

    You can upload up to 10 files with a size limit of 8 MB per file.

  5. Click Run to analyze the files and get a preview of the results.

The document action editor shows a preview of the analyzed document that you can zoom in and out for better visibility. Navigate the different pages of the document using the Previous (<) and Next (>) buttons. Switching pages updates the extracted values shown in the Outputs section.

IDP highlights fields in yellow when the extracted values have a confidence score below the configured threshold.

After uploading the sample files, configure the schema.

Configure the Schema for the Extraction

Configure the schema by selecting fields to hide from the response, fields that are required, and the minimum confidence score accepted for each field:

  1. In the Outputs section, click Fields and select any of the extracted field names to configure the following settings:

    • Visibility: defines if this field shows in the output JSON result. Click Visibility (2%) to hide this field.

    • Threshold: the minimum required confidence score accepted for this field. If the returned Confidence value is below the threshold, the document is queued for human review.

    • Required: select this option to send the document to review if the field is missing or can’t be extracted.

    You can click Focus (2%) to center the preview in the corresponding field.

  2. If your document contains tables, click Tables to configure the extraction settings for the table columns.

After configuring the schema, add Prompts to your document action.

Add Prompts to Refine the Result

Add Prompts to refine the results of the extraction by asking questions about the document using natural language:

  1. In the Outputs panel, click Prompts.

  2. Click Add New.

  3. Configure the required details:

    • Name: a unique name for the query.

    • Instruction: a question or request in English, using natural language.

      Prompts don’t support special characters. Ensure you use alphanumeric characters when writing your prompts. This limitation doesn’t apply to documents, which can contain any type of characters or symbols.
    • Required: select this option to send the document to review if the question can’t be answered.

    • Confidence Threshold: the minimum accepted value to prevent the document from getting queued for review.

  4. Click Add.

    When you click Add and Run, IDP saves the question, processes the document, and shows the results along with a confidence score for the specified question.

  5. Click Save.