N/documentCapture Module

Note:

The content in this help topic pertains to SuiteScript 2.1.

Load the N/documentCapture module to extract text content from supported documents.

The N/documentCapture module lets you programmatically extract structured content and key information from a variety of document types (such as invoices, receipts, contracts, and so on) directly within NetSuite. This module uses the AI-driven capabilities of the Oracle Cloud Infrastructure (OCI) Document Understanding service and can automate document processing, reduce manual data entry, and enhance business workflows. For more information about the OCI Document Understanding service, refer to Document Understanding in the Oracle Cloud Infrastructure Documentation.

This module provides the following features and benefits:

To learn how to get started with the N/documentCapture module, see Getting Started with the N/documentCapture Module.

In This Help Topic

N/documentCapture Module Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Object

documentCapture.Cell

Object

Server scripts

An extracted table cell from a document.

documentCapture.Document

Object

Server scripts

The extracted data from a document.

documentCapture.Field

Object

Server scripts

An extracted field from a document.

documentCapture.FieldLabel

Object

Server scripts

An extracted field label from a document.

documentCapture.FieldValue

Object

Server scripts

An extracted field value from a document.

documentCapture.Line

Object

Server scripts

An extracted line of text from a document.

documentCapture.Page

Object

Server scripts

An extracted page from a document.

documentCapture.Table

Object

Server scripts

An extracted table from a document.

documentCapture.TableRow

Object

Server scripts

An extracted table row from a document.

documentCapture.Word

Object

Server scripts

An extracted word from a document.

Method

documentCapture.documentToStructure(options)

documentCapture.Document

Server scripts

Extracts content from a document.

documentCapture.documentToStructure.promise(options)

Promise

Server scripts

Asynchronously extracts content from a document.

documentCapture.documentToText(options)

string

Server scripts

Extracts text content from a PDF file.

documentCapture.documentToText.promise(options)

Promise

Server scripts

Asynchronously extracts text content from a PDF file.

documentCapture.getRemainingConcurrency()

number

Server scripts

Returns the number of available concurrent requests remaining.

documentCapture.getRemainingConcurrency.promise()

Promise

Server scripts

Asynchronously returns the number of available concurrent requests remaining.

documentCapture.getRemainingFreeUsage()

number

Server scripts

Returns the number of free document capture requests remaining for the current month.

documentCapture.getRemainingFreeUsage.promise()

Promise

Server scripts

Asynchronously returns the number of free document capture requests remaining for the current month.

documentCapture.parseResult(options)

documentCapture.Document

Server scripts

Converts a JSON file into a documentCapture.Document object.

Enum

documentCapture.DocumentType

enum

Server scripts

Holds values for the document type.

documentCapture.Feature

enum

Server scripts

Holds values for the feature to extract.

documentCapture.FieldType

enum

Server scripts

Holds values for the type of a field.

documentCapture.Language

enum

Server scripts

Holds values for the language of a document.

Cell Object Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

Cell.confidence

number

Server scripts

The confidence level for the cell.

Cell.text

string

Server scripts

The extracted text of the cell.

Document Object Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

Document.mimeType

string

Server scripts

The MIME type of the document.

Document.pages

documentCapture.Page[]

Server scripts

The pages of the document.

Method

Document.getText()

string

Server scripts

Returns the entire text of the document.

Field Object Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

Field.label

documentCapture.FieldLabel

Server scripts

The label (name) of the field.

Field.type

string

Server scripts

The type of the field.

Field.value

documentCapture.FieldValue

Server scripts

The value of the field.

FieldLabel Object Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

FieldLabel.confidence

number

Server scripts

The confidence level for the field label.

FieldLabel.name

string

Server scripts

The name of the field label.

FieldValue Object Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

FieldValue.confidence

number

Server scripts

The confidence level for the field value.

FieldValue.text

string

Server scripts

The text of the field value.

Line Object Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

Line.confidence

number

Server scripts

The confidence level for the line.

Line.text

string

Server scripts

The text of the line.

Page Object Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

Page.detectedDocumentTypes

Object[]

Server scripts

A set of confidence levels indicating whether the page represents a particular type of document.

Page.fields

documentCapture.Field[]

Server scripts

The extracted fields from the page of a document.

Page.lines

documentCapture.Line[]

Server scripts

The extracted lines from the page of a document.

Page.tables

documentCapture.Table[]

Server scripts

The extracted tables from the page of a document.

Page.words

documentCapture.Word[]

Server scripts

The extracted words from the page of a document.

Method

Page.getText()

string

Server scripts

Returns the entire text of the page.

Table Object Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

Table.bodyRows

documentCapture.TableRow[]

Server scripts

The extracted body rows from the table in a document.

Table.columnCount

number

Server scripts

The number of extracted columns from the table in a document.

Table.confidence

number

Server scripts

The confidence level for the table.

Table.footerRows

documentCapture.TableRow[]

Server scripts

The extracted footer rows from the table in a document.

Table.headerRows

documentCapture.TableRow[]

Server scripts

The extracted header rows from the table in a document.

Table.rowCount

number

Server scripts

The number of extracted rows from the table in a document.

TableRow Object Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

TableRow.cells

documentCapture.Cell[]

Server scripts

The extracted cells in the table row.

Word Object Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

Word.confidence

number

Server scripts

The confidence level for the word.

Word.text

string

Server scripts

The extracted text of the word.

Related Topics

General Notices