OcrSampleDocument

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.

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

The OcrSampleDocument type doesn’t need to represent a real sample document. It can also be an abstract document that represents all documents of the same DocumentType. In such cases, the contentAsset and documentHeight fields are null.

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

OcrSampleDocument components have the suffix .ocrSampleDocument and are stored in the ocrSampleDocuments 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 

applicationType 

  • Type: OcrApplicationType (enumeration of type string)
  • Required: No
  • Description: The type of application using the OCR sample document.
  • Possible values:
    • EinsteinDocumentReader
    • Industries

contentAsset 

  • Type: string

  • Required: No

  • Description: The ID of the OCR sample document asset.

    This field is null if the OcrSampleDocument is an abstract document representing the DocumentType.

documentHeight 

  • Type: double

  • Required: No

  • Description: The normalized height of the OCR sample document page.

    This field is null if the OcrSampleDocument is an abstract document representing the DocumentType.

documentType 

  • Type: string
  • Required: Yes
  • Description: Required. The type of the OCR sample document.

masterLabel 

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

ocrSampleDocumentFields 

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

ocrSampleDocumentPages 

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

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: 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 used as a reference while extracting and mapping information from a customer form.

ocrSampleDocumentPage 

  • Type: string

  • Required: No

  • Description: A reference to a page of the OCR sample document that contains the key.

    This field is null if the OcrSampleDocument is an abstract document representing the DocumentType.

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.

OcrSampleDocumentPage Type 

Represents a collection of fields that define a page in the OCR sample document. This type exists only if the OcrSampleDocument is a real sample document and not an abstract document representing the DocumentType.

Fields 

ocrSampleDocument 

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

ocrSampleDocumentPageItems 

  • Type: OcrSampleDocumentPageItem[]
  • Required: No
  • Introduced: API version 56.0
  • Description: The collection of page items with the associated OCR sample document page.

pageHeight 

  • Type: double
  • Required: No
  • Description: The normalized height of the OCR sample document page.

pageNumber 

  • Type: int
  • Required: Yes
  • Description: Required. The page number of the page in the associated OCR sample document.

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.

Declarative Metadata Sample Definition 

The following is an example of a OcrSampleDocument component.

1<?xml version="1.0" encoding="UTF-8"?>
2<OcrSampleDocument xmlns="http://soap.sforce.com/2006/04/metadata">
3   <contentAsset>asset_01jpeg</contentAsset>
4   <documentHeight>1.24</documentHeight>
5   <documentType>Form</documentType>
6   <masterLabel>Form</masterLabel>
7   <ocrSampleDocumentFields>
8   ...<cellColumnNumber>1</cellColumnNumber>
9      <cellColumnSpanValue>1</cellColumnSpanValue>
10      <cellRowNumber>1</cellRowNumber>
11      <cellRowSpanValue>1</cellRowSpanValue>
12      <fieldLabelMaxX>0.5975854</fieldLabelMaxX>
13      <fieldLabelMaxY>0.46625894</fieldLabelMaxY>
14      <fieldLabelMinX>0.5065626</fieldLabelMinX>
15      <fieldLabelMinY>0.39605626</fieldLabelMinY>
16      <keyContent>Last Name</keyContent>
17     <ocrSampleDocument>image240</ocrSampleDocument>
18     <ocrSampleDocumentPage>1</ocrSampleDocumentPage>
19     <ocrSampleDocumentPageItem>
20         <hasHeader>false</hasHeader>
21         <sequenceNumber>1</sequenceNumber>
22         <title>Table1</title>
23         <type>TABLE</type>
24     </ocrSampleDocumentPageItem>
25   </ocrSampleDocumentFields>
26   <ocrSampleDocumentPages>
27      <ocrSampleDocument>Form</ocrSampleDocument>
28      <pageHeight>1.0</pageHeight>
29      <pageNumber>1</pageNumber>
30   </ocrSampleDocumentPages>
31   <ocrSampleDocumentPages>
32      <ocrSampleDocument>Form</ocrSampleDocument>
33      <pageNumber>2</pageNumber>
34   </ocrSampleDocumentPages>
35</OcrSampleDocument>

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>DocumentType</name>
6   </types>
7   <types>
8      <members>*</members>
9      <name>ContentAsset</name>
10   </types>
11   <types>
12      <members>*</members>
13      <name>OcrSampleDocument</name>
14   </types>
15   <version>68.0</version>
16</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.