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.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

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.

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

Special Access Rules 

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

Fields 

contentAsset 

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

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

Note

documentHeight 

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

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

Note

documentType 

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

masterLabel 

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

ocrSampleDocumentFields 

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

ocrSampleDocumentPages 

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

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: Name of the referred field value. Available in API version 56.0 and later.

isAutoExtractedValue 

  • Field Type: boolean
  • Description: Indicates whether the key is automatically extracted (true) or not (false). Available in API version 57.0 and later.

This field helps to distinguish auto-extracted keys from manual ones.

Note

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 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.

Note

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.

OcrSampleDocumentPage 

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.

ocrSampleDocument 

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

ocrSampleDocumentPageItems 

  • Field Type: OcrSampleDocumentPageItem[]
  • Description: The collection of page items with the associated OCR sample document page. Available in API version 56.0 and later.

pageHeight 

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

pageNumber 

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

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.

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 

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.