OcrTemplate

Represents the details of the mapping between a form and a Salesforce object using Intelligent Document Reader.This type extends the Metadata metadata type and inherits its fullName field.

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

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 55.0 and later.

Special Access Rules 

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

Fields 

active 

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

description 

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

documentType 

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

masterLabel 

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

ocrTargetObjects 

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

ocrTemplateSampleDocuments 

  • Field Type: OcrTemplateSampleDocument[]
  • 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 

  • Field Type: integer
  • Description: The number of pages in the form from which information is extracted.

templateName 

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

OcrTargetObject 

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

ocrTargetObjectFieldMappings 

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

targetObject 

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

targetObjectRecordType 

  • Field Type: string
  • Description: The developer name of the record type of the target object. Available in API version 56.0 and later.

OcrTargetObjFieldMapping 

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

ocrSampleDocField 

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

targetField 

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

type 

  • Field Type: OcrMappingType (enumeration of type string)

  • Description: Required. Specifies the type of mapping. Available in API version 56.0 and later.

  • Default value: FormField

  • Possible values:

    • FormField
    • TableColumn

OcrSampleDocumentField 

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

cellColumnNumber 

  • Field Type: int
  • Description: The column number in the item with the cell storing this field’s value. Available in API version 56.0 and later.

cellColumnSpanValue 

  • Field Type: int
  • Description: The number of columns that span the cell storing this field’s value. Available in API version 56.0 and later.

cellRowNumber 

  • Field Type: int
  • Description: The row number in the item with the cell storing this field’s value. Available in API version 56.0 and later.

cellRowSpanValue 

  • Field Type: int
  • Description: The number of rows that span the cell storing this field’s value. Available in API version 56.0 and later.

fieldLabelMaxX 

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

fieldLabelMaxY 

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

fieldLabelMinX 

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

fieldLabelMinY 

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

fieldValueName 

  • Field Type: string
  • Description: The name of the referred field value. Available in API version 56.0 and later.

keyContent 

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

ocrSampleDocument 

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

ocrSampleDocumentPage 

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

ocrSampleDocumentPageItem 

  • Field Type: OcrSampleDocumentPageItem[]
  • Description: A reference to the item on the sample document page containing this field’s value. Available in API version 56.0 and later.

OcrSampleDocumentPageItem 

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

hasHeader 

  • Field Type: boolean
  • Description: Indicates whether the OCR sample document page item has a header (true) or not (false). Available in API version 56.0 and later.
  • Default value: false

sequenceNumber 

  • Field Type: int
  • Description: Required. The sequence number of the item on an OCR sample document page with multiple items. Available in API version 56.0 and later.

title 

  • Field Type: string
  • Description: The title of the OCR sample document page item. Available in API version 56.0 and later.

type 

  • Field Type: ItemType (enumeration of type string)
  • Description: Required. Specifies the type of OCR sample document page item. Valid value is TABLE. Available in API version 56.0 and later.

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.

ocrSampleDocument 

  • Field Type: string
  • Description: 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            <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 

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.