Create Schema for Custom Documents
Create a schema for custom documents (which are not supported out of the box) to extract information from similar documents using SAP Document AI.
Overview
You will learn
- How to create a schema for custom documents
- How to add standard and custom data fields for the header information of custom documents
Prerequisites
Steps
Intro
The core functionality of SAP Document AI is to automatically extract structured information from documents using machine learning. SAP Document AI supports extraction from the following standard document types out of the box: invoices, payment advices, and purchase orders.
You can also use the Schema Configuration and Template features to extract information from custom documents that are different from the standard document types. You can customize the information extracted from custom document types by creating a schema and adding the specific information that you have in your documents.
In this tutorial, we’ll use power of attorney documents as an example of a custom document type that is not supported by SAP Document AI out of the box. A power of attorney document is a legal instrument authorizing one to act as the attorney or agent for another person in specified or all legal or financial matters.
If you are new to the SAP Document AI basic UI, first try out the tutorial: Use Machine Learning to Extract Information from Documents with SAP Document AI Basic UI.
Open the SAP Document AI basic UI, as described in the tutorial: Use Trial to Subscribe to the SAP Document AI Basic UI or Use Free Tier to Subscribe to SAP Document AI Basic UI.
- To access the Schema Configuration and Template features, ensure that you use the
blocks_of_100plan to create the service instance for SAP Document AI Trial.

Access - And make sure you’re assigned to the role collection:
Document_Information_Extraction_UI_Templates_Admin_trial(orDocument_Information_Extraction_UI_Templates_Adminif you’re using the free tier option). For more details about how to assign role collections, see step 2 in the tutorial: Use Trial to Subscribe to the SAP Document AI Basic UI, or step 3 in the tutorial: Use Free Tier to Subscribe to SAP Document AI Basic UI.

Access - After assigning new role collections, Log Off from the UI application to see all features you’re now entitled to try out.

Access - To access the Schema Configuration and Template features, ensure that you use the
In the left navigation pane, click Schema Configuration.

Access Schema Configuration
Here, you find the SAP schemas. The SAP Document AI basic UI provides preconfigured SAP schemas for the following standard document types:
- Purchase order
- Payment advice
- Invoice
In addition, thereβs an SAP schema for custom documents (SAP_OCROnly_schema). You can use SAP schemas unchanged to upload documents.
NOTE: You canβt edit or delete original SAP schemas. Always create a copy and then edit the default fields, as required.

CAUTION:
When using the free tier option for SAP Document AI or a trial account, be aware of the technical limits listed in Free Tier Option and Trial Account Technical Constraints.
To create your own schema, click Create.

In the dialog that appears, enter a name for your schema, power_of_attorney_schema, for example. Note that the name cannot include blanks. Further, select Custom as your Document Type and Document for OCR Engine Type.
Click Create to create the schema.

Now, your schema shows up in the list. Access the schema by clicking on the row.

To define your first header field, click Add.

For each field, you have to enter a name, a data type, and a setup type. Adding a description is optional. Default extractors aren’t available for custom documents. The available data types are string, number, date, discount, currency, and country/region.
The available setup types are auto and manual. The setup type auto supports extraction using the solution’s machine learning models. You must specify a default extractor (standard fields supported by SAP Document AI) for this setup type. It can only be used in schemas created for standard document types. The setup type manual supports extraction using a template. Itβs available in schemas created for standard or custom document types.
If you’d like to find out more about setup types and how they relate to document types, extraction methods, and default extractors, see Setup Types.
As your first header field, add the shipper number of your power of attorney document.
Enter an appropriate name for your field,
shipperNumber, for example.Select
stringfor theData Type. Note that a shipper number is astring, even though it consists of numbers, as it is an arbitrary combination of numbers without meaning. In contrast, price is an example of the data typenumber.Select
manualfor theSetup Typeand click Save to add the header field.
Create Number
The field now displays in your list of header fields, where you again find all the information that you’ve just entered. You can edit or delete the field by clicking the respective icons on the right.

Click Add again to open the Header Field dialog.
Enter a name for your second header field,
fullName, for example.Select
stringfor theData Type.Select
manualfor theSetup Typeand click Save to add the field.
Create Name
Go ahead and add the header fields shown in the table and image below. Pay attention to the different data types. Feel free to extend or reduce the list of header fields.
| Field Name | Data Type | Setup Type |
|---|---|---|
shipperNumber | string | manual |
fullName | string | manual |
EIN | string | manual |
state | string | manual |
fullAddress | string | manual |
capacity | string | manual |
date | date | manual |

NOTE: The SAP Document AI basic UI also includes a feature that allows you to group schema fields by category. To use this feature, you must first activate it under UI Settings. For simplicity’s sake, we haven’t included the feature in this tutorial. If you’d like to find out more about it, see Schema Field Categories.
Once you’ve added all fields, the schema needs to be activated so that it can be used to extract information from documents. Right now, the schema has the status DRAFT, indicating that it cannot be used yet.
To activate the schema, click Activate.

Now, the status of your schema changes to ACTIVE. To make changes to your schema, you have to Deactivate it first.

Congratulations, you’ve created and activated your own schema for power of attorney documents.
In the next tutorial: Create Template for Custom Documents, you’ll create a template that uses your schema, and associate documents with your template to show SAP Document AI where each field is located in the document.
Resources
Discussion
Share feedback on this tutorial or join the conversation in SAP Community.