Automatically populate forms using AI

Use the AI Data Extraction question type to extract data from documents by leveraging AI services such as OpenAI or Claude. Eliminate manual parsing by allowing AI to read the document and return the required information in JSON format. Map the returned JSON fields into form fields so the data is stored and used like any other form input.

Prerequisites

Before beginning, ensure you have:

  • An account with a chosen AI provider (e.g. OpenAI or Claude).

  • A valid API key from the AI provider.

  • Administrative access to the workflow automation system.

  • Sample documents for testing the extraction process.

Supported AI providers

  • OpenAI

    • Offers various models, including GPT-3.5 and GPT-4o.

    • Refer to OpenAI’s documentation for up-to-date details on model capabilities, pricing, rate limits, and file-size constraints.

  • Claude (Anthropic)

    • Provides models capable of handling large context windows (potentially up to 100K tokens).

    • Refer to Anthropic’s documentation for the latest information on model features, usage limits, and file size constraints.

Supported file types and sizes

Most AI providers accept common document formats such as PDF, DOC, DOCX, and TXT, and occasionally other text-based files. However, specific limits and supported formats may vary.

  • OpenAI

    • Accepts a range of file types (TXT, PDF, DOCX, CSV, JSON, etc.).

    • Currently supports file sizes up to 512 MB, per the OpenAI documentation.

  • Claude (Anthropic):

    • Supports multiple text-based file types, including PDFs.

    • Currently allows file sizes up to 30 MB. Refer to Anthropic’s documentation for the latest details.

Always verify the current constraints directly from the provider’s documentation, as limits may change over time.

Workflow overview

Below is a simplified workflow for using the AI Data Extraction question.

  1. Create an API credential
    Generate an API key on the provider’s website (OpenAI or Claude). Then register it in Nutrient Workflow Automation’s credentials manager.

  2. Create a form
    Add all fields that should be populated by AI to ensure the data can be mapped properly later.

  3. Create and configure the AI question type

    • Select the AI provider credential.

    • Add a custom prompt describing what to extract.

    • Test the prompt with sample documents and refine as needed.

    • Map the AI’s JSON response to the form fields defined in Step 2.

Step 1: Create a new API credential

  1. Obtain an API key from an AI provider:

    • OpenAI — Log in to the OpenAI account and create a new API key.

    • Claude (Anthropic) — Log in to the Claude account and follow the instructions to create a new API key.

  2. To add the credential to Nutrient Workflow Automation, first open AI Sources.

01 - AI Sources - 2.png

  1. Click Add Connection and select the AI Provider and Model.

02 - Add new AI connection - 0.png

  1. Choose the Select Credentials dropdown and either select an existing one or add a new one.

02 - Add new AI connection - 1.png

  1. Enter a name for the credential in the Resource Name field — for example, OpenAI API Key or Claude Key.

  2. Paste the API key from the AI provider in the corresponding field.

03 - Credentials - 0.png

  1. Click Save.

Step 2: Create a form containing all the fields for AI extraction

Create or edit a form that will hold the data extracted by AI. For example, if extracting invoice information, include questions such as:

  • Invoice number

  • Due date

  • Customer name

  • Payment terms

  • Total amount

  1. Navigate to Forms in the Nutrient Workflow Automation portal.

  2. Click Add Form.

  3. Add all relevant questions (e.g. text, date, etc.) corresponding to the data that the AI will extract.

04 - Form.png

Step 3: Create and configure the AI Data Extraction question

  1. In the form designed in Step 2, drag and drop the AI Data Extraction question.

05 - AI Data Extraction QT - 1.png

  1. Click the pencil icon to configure the AI Data Extraction question.

06 - Configure AI Data Extraction - 1.png

  1. Under AI Settings, choose the AI connection created in Step 1.

07 - AI Settings - 2.png

  1. Set the prompt. This is the instruction given to AI to specify what to extract and how to format the answer. This step is crucial for getting accurate results.

  • Enter a clear and concise prompt describing the information needed.

  • Specify the exact fields expected in the response.

  • Keep in mind that AI can add extra commentary, so explicitly instruct it to only return the fields required.

An example prompt might be:

Extract the following from the attached document:
1. Title
2. Customer Name
3. Summary (1-2 paragraphs)
4. Invoice Number

Large language models might guess or invent information not found in the source document. If precision is critical, add a disclaimer such as: Only provide information you are 100 percent sure about. If you are unsure or the data is not in the document, respond with “Not available.”

Nutrient Workflow Automation automatically enforces JSON output. If the response isn’t valid JSON, refine the prompt or add supplemental instructions.

  1. Under Process a sample document, upload a sample document (PDF, DOCX, or other supported formats) to test the prompt.

08 - Process sample document - 3.png

  1. Click Run AI Processor to see the AI-generated response.

09 - Processing results - 1.png

  1. Refine the prompt:

  • Adjust the prompt if certain fields are missing or incorrect.

  • Test with various sample files until the output is satisfactory.

  1. Map the AI response to form questions:

  • In Mappings, click Add Mapping to connect each JSON key from the AI response to the corresponding form question.

  • Click Save Changes.

10 - Mappings - 1.png

Step 4: Preview and validate

  1. Click Preview to confirm how the question behaves and to ensure the configured fields display correctly.

  2. Attach a document to the AI Data Extraction question to trigger AI processing.

11 - Run - 2.png

  1. Review the populated fields once the AI finishes extraction. Verify that the mapped fields contain the expected data. Return to the previous steps to refine the configuration if the output needs improvement.

Tips and best practices

  • Provide clear instructions — Write concise, direct prompts for better results.

  • Validate the AI output — Confirm the AI response is formatted correctly as JSON with the required fields.

  • Refine iteratively — Small changes in prompt wording can produce significantly different results.

  • Watch for hallucinations — AI may sometimes provide information not present in the document. If this occurs, reinforce instructions to omit any unverified content.