OcrTemplate

Represents the details of the mapping between a form and a Salesforce object using Intelligent Form Reader.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

OcrTemplate components have the suffix .ocrTemplate and are stored in the ocrTemplates folder.

Version 

Introduced in API version 52.0.

Special Access Rules 

To use this metadata type, your Salesforce org must have the AWSTextract1000LimitAddOn license.

Fields 

active 

  • Type: boolean
  • Required: No
  • Description: Indicates whether the OCR template is active (true) or not (false).

description 

  • Type: string
  • Required: No
  • Description: The description of the OCR template.

documentType 

  • Type: string
  • Required: Yes
  • Description: Required. The document type for which this template defines mappings.

masterLabel 

  • Type: string
  • Required: Yes
  • Description: Required. The label for the OCR template.

ocrTargetObjects 

  • Type: OcrTargetObject[]
  • Required: No
  • Description: Represents the details of the object to which information from a form is extracted and mapped.

ocrTemplateSampleDocuments 

  • Type: OcrTemplateSampleDocument[]
  • Required: No
  • Description: 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 

  • Type: int
  • Required: No
  • Description: The number of pages in the form from which information is extracted.

templateName 

  • Type: string
  • Required: Yes
  • Description: Required. The name of the OCR template.

OcrSampleDocumentField Type 

Represents the details of the field in a form whose value is extracted and mapped to a Salesforce object field.

Fields 

cellColumnNumber 

  • Type: int
  • Required: No
  • Introduced: API version 56.0
  • Description: The column number in the item with the cell storing this field’s value.

cellColumnSpanValue 

  • Type: int
  • Required: No
  • Introduced: API version 56.0
  • Description: The number of columns that span the cell storing this field’s value.

cellRowNumber 

  • Type: int
  • Required: No
  • Introduced: API version 56.0
  • Description: The row number in the item with the cell storing this field’s value.

cellRowSpanValue 

  • Type: int
  • Required: No
  • Introduced: API version 56.0
  • Description: The number of rows that span the cell storing this field’s value.

fieldLabelMaxX 

  • Type: double
  • Required: No
  • Description: A normalized coordinate representing the right edge of the bounding box of the key.

fieldLabelMaxY 

  • Type: double
  • Required: No
  • Description: A normalized coordinate representing the bottom edge of the bounding box of the key.

fieldLabelMinX 

  • Type: double
  • Required: No
  • Description: A normalized coordinate representing the left edge of the bounding box of the key.

fieldLabelMinY 

  • Type: double
  • Required: No
  • Description: A normalized coordinate representing the top edge of the bounding box of the key.

fieldValueName 

  • Type: string
  • Required: No
  • Introduced: API version 56.0
  • Description: The name of the referred field value.

isAutoExtractedValue 

  • Type: boolean
  • Required: No
  • Introduced: API version 57.0
  • Description: Indicates whether the key is automatically extracted (true) or not (false). This field helps to distinguish auto-extracted keys from manual ones.

keyContent 

  • Type: string
  • Required: No
  • Description: The content in a particular area of the form, representing the field that is extracted by OCR.

ocrSampleDocument 

  • Type: string
  • Required: Yes
  • Description: Required. The associated OCR sample document is used as a reference while extracting and mapping information from a customer form.

ocrSampleDocumentPage 

  • Type: string
  • Required: No
  • Description: A collection of fields that define a page in the OCR sample document.

ocrSampleDocumentPageItem 

  • Type: OcrSampleDocumentPageItem
  • Required: No
  • Introduced: API version 56.0
  • Description: A reference to the item on the sample document page containing this field’s value.

OcrSampleDocumentPageItem Type 

Represents a foreign key reference to the item on the sample document page containing a value for the page item.

Fields 

hasHeader 

  • Type: boolean
  • Required: No
  • Introduced: API version 56.0
  • Description: Indicates whether the OCR sample document page item has a header (true) or not (false). The default value is false.

sequenceNumber 

  • Type: int
  • Required: Yes
  • Introduced: API version 56.0
  • Description: Required. The sequence number of the item on an OCR sample document page with multiple items.

title 

  • Type: string
  • Required: No
  • Introduced: API version 56.0
  • Description: The title of the OCR sample document page item.

type 

  • Type: ItemType (enumeration of type string)

  • Required: Yes

  • Introduced: API version 56.0

  • Description: Required. Specifies the type of OCR sample document page item.

    Valid value is TABLE.

OcrTargetObject Type 

Represents the details of the object to which information from a form is extracted and mapped.

Fields 

ocrTargetObjFieldMappings 

  • Type: OcrTargetObjFieldMapping[]
  • Required: No
  • Description: Represents the details of how information from a form field is mapped to fields in an object.

targetObject 

  • Type: string
  • Required: Yes
  • Description: Required. The object to which information from a form is mapped.

targetObjectRecordType 

  • Type: string
  • Required: No
  • Introduced: API version 56.0
  • Description: The developer name of the record type of the target object.

OcrTargetObjFieldMapping Type 

Represents the details of how information from a form field is mapped to fields in an object.

Fields 

ocrSampleDocField 

  • Type: OcrSampleDocumentField
  • Required: No
  • Description: The details of the field in a form whose value is extracted and mapped to a Salesforce object field.

targetField 

  • Type: string
  • Required: Yes
  • Description: Required. The field to which information is mapped.

type 

  • Type: OcrMappingType (enumeration of type string)
  • Required: Yes
  • Introduced: API version 56.0
  • Description: Required. Specifies the type of mapping. The default value is FormField.
  • Possible values:
    • FormField
    • TableColumn

OcrTemplateSampleDocument Type 

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 

ocrSampleDocument 

  • Type: string
  • Required: No
  • Description: The associated OCR sample document is 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            <cellColumnNumber>1</cellColumnNumber>
10            <cellColumnSpanValue>1</cellColumnSpanValue>
11            <cellRowNumber>1</cellRowNumber>
12            <cellRowSpanValue>1</cellRowSpanValue>
13             <fieldLabelMaxX>0.5975854</fieldLabelMaxX>
14             <fieldLabelMaxY>0.46625894</fieldLabelMaxY>
15             <fieldLabelMinX>0.5065626</fieldLabelMinX>
16             <fieldLabelMinY>0.39605626</fieldLabelMinY>
17             <keyContent>Last Name</keyContent>
18             <ocrSampleDocument>image240</ocrSampleDocument>
19             <ocrSampleDocumentPage>1</ocrSampleDocumentPage>
20             <ocrSampleDocumentPageItem>
21                <hasHeader>false</hasHeader>
22                <sequenceNumber>1</sequenceNumber>
23                <title>Table1</title>
24                <type>TABLE</type>
25            </ocrSampleDocumentPageItem>
26        </ocrSampleDocField>
27      <targetField>Account.Name</targetField>
28      <type>TableColumn</type>
29      </ocrTargetObjFieldMappings>
30      <targetObject>Account</targetObject>
31      <targetObjectRecordType>Account.X240</targetObjectRecordType>
32   </ocrTargetObjects>
33   <ocrTemplateSampleDocuments>
34      <ocrSampleDocument>Form</ocrSampleDocument>
35   </ocrTemplateSampleDocuments>
36   <pageCount>10</pageCount>
37   <templateName>Form Test</templateName>
38</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>68.0</version>
8</Package>

Wildcard Support in the Manifest File 

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.