documentCapture.Field

Note:

The content in this help topic pertains to SuiteScript 2.1.

Object Description

An extracted field from a document.

When extracted from a document, a field is represented by a key-value pair. The key is the name or label of the field (as a documentCapture.FieldLabel object), and the value is the field's value (as a documentCapture.FieldValue object). This object includes properties for the field label (Field.label), type (Field.type), and value (Field.value).

Fields are included in extracted content only when the documentCapture.Feature.FIELD_EXTRACTION feature is specified when you call documentCapture.documentToStructure(options) (or when you submit an asynchronous extraction task then parse the result using documentCapture.parseResult(options)).

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Module

N/documentCapture Module

Methods and Properties

Field Object Members

Since

2025.2

Syntax

Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/documentCapture Module Script Samples.

            // Add additional code
...

const extractedData = documentCapture.documentToStructure({
    file: file.load("SuiteScripts/sample_invoice.pdf"),
    documentType: documentCapture.DocumentType.INVOICE,
    features: [documentCapture.Feature.FIELD_EXTRACTION]
});

const field = extractedData.pages[0].fields[0];

...
// Add additional code 

          

Related Topics

General Notices