Newer Version Available
OcrTemplate
Represents the details of the mapping between a form and a
Salesforce object using Intelligent Form Reader.This type
extends the Metadata metadata type and inherits its
fullName field.
File Suffix and Directory Location
OcrTemplate components have the suffix .ocrTemplate and are stored in the ocrTemplates folder.
Version
OcrTemplate components are available in API version 52.0 and later.
Special Access Rules
To use this metadata type, your Salesforce org must have the AWSTextract1000LimitAddOn license.
Fields
| Field Name | Field Type | Description |
|---|---|---|
| active | boolean | Indicates whether the OCR template is active (true) or not (false). |
| documentType | string | Required. The document type for which this template defines mappings. |
| masterLabel | string | Required. The label for the OCR template. |
| ocrTargetObjects | OcrTargetObject[] | Represents the details of the object to which information from a form is extracted and mapped. |
| ocrTemplateSampleDocuments | OcrTemplateSampleDocument[] | Represents the details of a sample document or a document type that's used as a reference while extracting and mapping information from a customer form. |
| pageCount | integer | The number of pages in the form from which information is extracted. |
| templateName | string | Required. The name of the OCR template. |
Fields
| Field Name | Field Type | Description |
|---|---|---|
| ocrTargetObjectFieldMappings | OcrTargetObjFieldMapping[] | Represents the details of how information from a form field is mapped to fields in an object. |
| targetObject | string | Required. The object to which information from a form is mapped. |
Fields
| Field Name | Field Type | Description |
|---|---|---|
| ocrSampleDocField | OcrSampleDocumentField[] | Required. The details of the field in a form whose value is extracted and mapped to a Salesforce object field. |
| targetField | string | Required. The field to which information is mapped. |
Represents the details of the field in a form whose value is extracted and mapped to a Salesforce object field.
Fields
| Field Name | Field Type | Description |
|---|---|---|
| fieldLabelMaxX | double | A normalized coordinate representing the right edge of the bounding box of the key. |
| fieldLabelMaxY | double | A normalized coordinate representing the bottom edge of the bounding box of the key. |
| fieldLabelMinX | double | A normalized coordinate representing the left edge of the bounding box of the key. |
| fieldLabelMinY | double | A normalized coordinate representing the top edge of the bounding box of the key. |
| keyContent | string | Required. The content located in a particular area of the form, representing the field that is extracted by OCR. |
| ocrSampleDocument | string | Required. The associated OCR sample document used as a reference while extracting and mapping information from a customer form. |
| ocrSampleDocumentPage | string | A collection of fields that define a page in the OCR sample document. |
Represents the details of a sample document or a document type that's used as a reference while extracting and mapping information from a customer form.
Fields
| Field Name | Field Type | Description |
|---|---|---|
| ocrSampleDocument | string | The associated OCR sample document used as a reference while extracting and mapping information from a customer form. |
Declarative Metadata Sample Definition
The following is an example of a OcrTemplate component.
1<?xml version="1.0" encoding="UTF-8"?>
2<OcrTemplate xmlns="http://soap.sforce.com/2006/04/metadata">
3 <active>false</active>
4 <documentType>Form</documentType>
5 <masterLabel>Form Test 222</masterLabel>
6 <ocrTargetObjects>
7 <ocrTargetObjFieldMappings>
8 <ocrSampleDocField>
9 <fieldLabelMaxX>0.8</fieldLabelMaxX>
10 <fieldLabelMaxY>0.9</fieldLabelMaxY>
11 <fieldLabelMinX>0.7</fieldLabelMinX>
12 <fieldLabelMinY>0.5</fieldLabelMinY>
13 <keyContent>T</keyContent>
14 <ocrSampleDocument>Form</ocrSampleDocument>
15 <ocrSampleDocumentPage>1</ocrSampleDocumentPage>
16 </ocrSampleDocField>
17 <targetField>Case.Account</targetField>
18 </ocrTargetObjFieldMappings>
19 <targetObject>Case</targetObject>
20 </ocrTargetObjects>
21 <ocrTemplateSampleDocuments>
22 <ocrSampleDocument>Form</ocrSampleDocument>
23 </ocrTemplateSampleDocuments>
24 <pageCount>10</pageCount>
25 <templateName>Form Test</templateName>
26</OcrTemplate>The following is an example package.xml that references the previous definition.
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4 <members>*</members>
5 <name>OcrTemplate</name>
6 </types>
7 <version>52.0</version>
8</Package>