FieldLabel Object Members for SuiteScript 2.1

FieldLabel Object provides confidence and name properties for extracting field labels in SuiteScript 2.1, enhancing document processing.

·2 min read·View Oracle Docs

TL;DR Opening

The FieldLabel Object in SuiteScript 2.1 introduces two key properties: confidence and name, which facilitate the reliable extraction of field labels from documents. Utilizing these properties can greatly improve the accuracy of automated document processing in your scripts.

What are FieldLabel Object Members?

The FieldLabel object encompasses essential properties used in server scripts to evaluate and handle field labels derived from documents processed through the document capture functionality. The two main properties of the FieldLabel object are:

FieldLabel Properties

PropertyTypeDescription
FieldLabel.confidencenumberIndicates the confidence level of the field label extracted from a document. Range is between 0 (no confidence) to 1 (full confidence).
FieldLabel.namestringContains the extracted name of the field label.

Understanding the Confidence Level

The confidence property is a numerical indicator (between 0 and 1) that reflects how accurate the system believes the extracted name is. For example:

  • A confidence of 0.95 signifies a 95% certainty in the accuracy of the name.
  • This value can guide script decisions; set a threshold (like 0.90) to only accept highly confident name extractions, thus reducing potential errors.

Example Syntax

Below is a sample code snippet demonstrating how to utilize the FieldLabel object properties in SuiteScript:

suitescript
1// Add additional code
2...
3
4const extractedData = documentCapture.documentToStructure({
5 file: file.load("SuiteScripts/sample_tax_form.pdf"),
6 documentType: documentCapture.DocumentType.TAX_FORM,
7 features: [documentCapture.Feature.FIELD_EXTRACTION]
8});
9
10const fieldLabelToProcess = extractedData.pages[0].fields[0].label;
11
12if (fieldLabelToProcess.confidence > 0.9) {
13 // Accept the field name
14} else {
15 // Reject the field name
16}
17
18...
19// Add additional code

Important Errors

When working with FieldLabel object members, note that attempting to set the value for the properties will throw a READ_ONLY error. This indicates that the properties can only be accessed but not modified.

Who This Affects

  • Developers: Utilize these properties for enhanced document processing capabilities in server scripts.
  • Administrators: Manage and oversee implementations that involve document capture and processing.

Key Takeaways

  • The FieldLabel object improves document processing accuracy through confidence and name properties.
  • Employ confidence levels to filter and validate extracted names effectively.
  • Scripts must handle READ_ONLY errors when managing FieldLabel properties.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

Does the FieldLabel object apply to both WMS and standard NetSuite?
The FieldLabel object is specifically designed for use in SuiteScript 2.1 scripts and relates to document processing rather than Warehouse Management Systems (WMS).
How do I check the confidence level of an extracted field label?
You can check the confidence level by accessing the `confidence` property of the FieldLabel object. It returns a number between 0 and 1, indicating the system's confidence in the extracted name's accuracy.
What happens if I try to modify the properties of a FieldLabel object?
Attempting to modify the properties of a FieldLabel object will result in a `READ_ONLY` error, as these properties can only be accessed but not changed.
Is there a recommended threshold for the confidence property when processing field labels?
A common practice is to use a threshold value, such as 0.90, to only accept field names with high confidence. This helps reduce potential errors in automated document processing.
Source: FieldLabel Object Members Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Integration

View all Integration articles →