FieldValue Object Members in SuiteScript 2.1 Reference
FieldValue object members in SuiteScript 2.1 provide confidence levels and text values for extracted fields, crucial for accurate data processing.
The FieldValue object in SuiteScript 2.1 is essential for handling values extracted from documents, particularly when utilizing the N/documentCapture module. It is composed of two primary members: FieldValue.confidence and FieldValue.text, which are integral for ensuring accurate data extraction in your scripts.
What Are the Members of the FieldValue Object?
The FieldValue object includes the following members:
| Member Name | Return Type | Supported Script Types | Description |
|---|---|---|---|
FieldValue.confidence | number | Server scripts | Confidence level of the field value |
FieldValue.text | string | Server scripts | Text of the field value |
How Does the Confidence Property Work?
The FieldValue.confidence property is a numeric value ranging from 0 to 1, representing how sure the system is about the accuracy of the field value specified in FieldValue.text. A confidence level of 0.95 indicates that the service is 95% confident in the extracted field value, allowing developers to set thresholds for data acceptance to mitigate errors. For instance, you could decide to only accept values with a confidence above 0.90.
Example of Using FieldValue in a Script
Here’s a practical example of how you might utilize the FieldValue members in your SuiteScript:
1const extractedData = documentCapture.documentToStructure({2 file: file.load("SuiteScripts/sample_tax_form.pdf"),3 documentType: documentCapture.DocumentType.TAX_FORM,4 features: [documentCapture.Feature.FIELD_EXTRACTION]5});6 7const fieldValueToProcess = extractedData.pages[0].fields[0].value;8 9if (fieldValueToProcess.confidence > 0.9) {10 // Accept the field value11} else {12 // Reject the field value13}Error Codes
One important aspect to consider is that both properties are read-only. Attempting to set their values will trigger a READ_ONLY error.
Who This Affects
This reference impacts:
- Developers: Specifically those working on server scripts, enabling better data extraction handling.
- System Integrators: Who need to ensure data accuracy from document captures in their integrated systems.
Key Takeaways
- The FieldValue object members are essential for processing extracted data in SuiteScript 2.1.
FieldValue.confidenceallows setting accuracy thresholds for data handling.- Error handling is crucial as both properties are read-only.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
Is the FieldValue object applicable to both client and server scripts?
What happens if you attempt to modify the confidence level of a FieldValue object?
How can developers use the confidence property to enhance data accuracy in SuiteScript?
Does the FieldValue object require any specific feature or module within SuiteScript?
Was this article helpful?
More in Integration
- Natural Language Queries in NetSuite AI
MCP Standard Tools SuiteApp enables AI-driven data tasks in NetSuite, aligned with role permissions.
- Square Connector Integration in NetSuite 2026.1
Discover the Square Connector for seamless integration with NetSuite 2026.1, synchronizing transactions, orders, and inventory effortlessly.
- SuiteTalk Web Services Updates for NetSuite Integrations
SuiteTalk Web Services adds new Item Supply Plan support, enhancing integrations for efficient data management.
- SuiteTalk Web Services Enhancements in NetSuite
Explore the latest enhancements to SuiteTalk Web Services, improving integration and API functionalities in NetSuite.
Advertising
Reach Integration Professionals
Put your product in front of NetSuite experts who work with Integration every day.
Sponsor This Category