Modifying Fields for Document Types

Introduction

Each organization's documents are unique. Appian's Intelligent Document Processing (IDP) is flexible enough to allow you to tailor the application to your organization's needs.

IDP comes out-of-the box with Invoice, Purchase Order, Claim, and Receipt document types. If your organization has different documents that it wants to use, you can also add new document types.

Each of these document types are set up to extract certain fields. This page provides instructions for adding and removing fields so that you can modify the information that is extracted from each document type.

These instructions are specific to MySQL databases. If you use a different database, you may need to modify the steps.

Best practices for modifying document types

We suggest always adding and removing fields, instead of updating fields. This will make sure that the table columns and custom data type (CDT) fields match.

See Mapping Custom Data Types (CDTs) to Pre-defined Database Tables for more information about making changes to existing CDTs.

Adding fields to a document type

If you're an Appian developer that needs to capture more data than what exists in the default document types of IDP, you can add fields to the document type's CDT.

In order to extract more fields for a document type, you will need to add the new field to the CDT and verify the data store.

Step 1: Add the new field to the CDT

In order to extract more information for a document type, you first need to add the new field to the CDT. See Appian Document Extraction to learn more about best practices for creating a new CDT and setting up the CDT fields for document extraction.

There are some extra steps we recommend to make sure the CDT field's column in the database table can accept large character values. Appian Text fields automatically use VARCHAR(255) for the column definition in the associated database table. This means that you can only write data to the column in the database table if it is 255 characters or less. Therefore, we recommend updating the column definition to text, which can handle more data. To do this, you will need to update the CDT using an XSD file.

To add the new field to the CDT:

  1. Open the CDT for the document type that you want to modify. The following are the names for the CDTs that are provided by default. If you want to modify a document type that you added, you would use that CDT.
    • Invoice: DU_Invoice
    • Purchase Order: DU_PurchaseOrder
    • Claims: DU_Claim
    • Receipt: DU_Receipt
  2. Create fields for the information you want to extract, using the following guidelines:
    • For the Type, select Text. If you are extracting a checkbox from your document, select Boolean.
    • Use camel case to format the field names.
      • Note: This makes sure the field names are formatted with proper casing and spaces when they are displayed in the interface that is used to reconcile extracted data. For example, the field name licenseNumber becomes License Number in the interface.
  3. Update the column definition in the CDT's XSD file to use text for the column definition.
    • Select the settings menu modify_fields_settings_menu > Download XSD.
    • Open the XSD file.
    • Find the column you just added and change <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo> to <xsd:appinfo source="appian.jpa">@Column(columnDefinition="text")</xsd:appinfo>
    • Save the XSD file.
    • Select the settings menu modify_fields_settings_menu > Create New Version from XSD.
    • Upload the XSD file you just saved.
    • A warning displays that says the data store will need to be updated. You will do this when you verify the data store.
    • Click CREATE NEW VERSION.

Step 2: Verify the data store

Verifying the data store adds the new field to the database table and makes sure that the CDT field names and data types match the database column names and data types.

See Data Stores for more information about editing data stores.

To verify the data store:

  1. In the Intelligent Document Processing (IDP) application, open the DU Data Store object.
  2. Click VERIFY. A "No matching tables found!" message appears.
  3. Click Download DDL Script and save the SQL file so you can use it to deploy the changes to another environment.
  4. Make sure Create tables automatically is selected, then click SAVE & PUBLISH.

Removing fields before they have been used in production

If you added a field and want to remove it, or if you want to remove fields from the default document types in IDP, you can remove these fields as long as the document type has not been used in production yet. If you want to remove fields from the default document type, it is best to do this during the initial application set up.

The only time you should delete fields is before you have started to use the document type in production. Otherwise, any reconciliation tasks that are already in process in production will error when they try to write the data to the database.

In order to stop extracting fields for a document type, you will need to remove the associated column from the database table, remove the field from the CDT, and verify the data store.

Step 1: Remove the associated column from the database table

Before making any changes in Appian Designer, you must first update the database table.

To update the database table:

  1. The following are the names for the CDTs that are provided by default. If you want to modify a document type that you added, you would use that CDT.
    • Invoice: duinvoice
    • Purchase Order: dupurchaseorder
    • Claims: duclaim
    • Receipt: dureceipt
  2. Remove the column that maps to the field you no longer want to extract.
    • Note: Save the SQL command you use to remove the column so that you can use it to deploy the changes to another environment.

Example

To delete the supplier field from the duinvoice table, you could execute a database command like the following. Note that this example uses MySQL syntax.

1
ALTER TABLE `duinvoice` DROP `supplier`;

Step 2: Remove the field from the CDT

After you have updated the database table, you can remove the field from the CDT.

See Mapping Custom Data Types (CDTs) to Pre-defined Database Tables for more information about making changes to CDTs.

  1. Open the CDT for the document type that you want to modify. The following are the names for the CDTs that are provided by default. If you want to modify a document type that you added, you would use that CDT.
    • Invoice: DU_Invoice
    • Purchase Order: DU_PurchaseOrder
    • Claims: DU_Claim
    • Receipt: DU_Receipt
  2. Remove the fields that you no longer want to extract by clicking the red x.
  3. Click SAVE CHANGES.

Step 3: Verify the data store

Verifying the data store makes sure that the CDT is mapped and ready to be used in IDP.

See Data Stores for more information about editing data stores.

To verify the data store:

  1. In the Intelligent Document Processing (IDP) application, open the DU Data Store object.
  2. Click VERIFY.
  3. Make sure an "Entity mappings verified" message displays.
    • If this message does not display, do not save the data store. The database table or CDT updates may not match the data store. Verify the changes made in steps one and two match each other, then try verifying again.
  4. Click SAVE & PUBLISH.
Open in Github Built: Thu, Oct 14, 2021 (02:43:30 PM)

On This Page

FEEDBACK