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.
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
| Property | Type | Description |
|---|---|---|
FieldLabel.confidence | number | Indicates the confidence level of the field label extracted from a document. Range is between 0 (no confidence) to 1 (full confidence). |
FieldLabel.name | string | Contains 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.95signifies a 95% certainty in the accuracy of thename. - 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:
1// Add additional code2...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 name14} else {15 // Reject the field name16}17 18...19// Add additional codeImportant 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
confidenceandnameproperties. - Employ confidence levels to filter and validate extracted names effectively.
- Scripts must handle
READ_ONLYerrors when managing FieldLabel properties.
Frequently Asked Questions (4)
Does the FieldLabel object apply to both WMS and standard NetSuite?
How do I check the confidence level of an extracted field label?
What happens if I try to modify the properties of a FieldLabel object?
Is there a recommended threshold for the confidence property when processing field labels?
Was this article helpful?
More in SuiteScript
- SuiteScript 2.1 Enhancements in NetSuite February Updates
SuiteScript 2.1 now supports async features and PATCH method. Discover the latest API and SuiteProcurement improvements.
- Scheduling Map/Reduce Script Deployments in NetSuite
Learn to schedule map/reduce script submissions, including one-time and recurring options in NetSuite.
- Binary File Support in N/https Module for SuiteScript
SuiteScript enhances capabilities with binary file support in the N/https module, allowing improved data handling in external communications.
- API Governance Units Calculation in NetSuite 2026.1
NetSuite 2026.1 introduces examples illustrating API governance unit calculations for both user event and scheduled scripts.
