Cell Object Members in SuiteScript 2.1 Documentation
Cell object members in SuiteScript 2.1 provide confidence levels and extracted text for data handling in documents.
Starting in SuiteScript 2.1, the Cell Object has been defined with crucial members that enhance the extraction of text from documents. This article explores the members of the Cell object, their types, and practical examples for developers utilizing this functionality.
What Are Cell Object Members?
The Cell Object contains several members that provide valuable information about individual cells extracted from documents. Here are the key members:
| Member Name | Return Type | Supported Script Types | Description |
|---|---|---|---|
Cell.confidence | number | Server scripts | Indicates the confidence level of the extracted text. |
Cell.text | string | Server scripts | Contains the extracted text from the cell. |
Detailed Member Descriptions
What Is Cell.confidence?
The Cell.confidence property is a numeric value ranging from 0 to 1 that signifies the service's confidence in the accuracy of the extracted text represented by Cell.text. For instance, a confidence score of 0.95 implies that the service is 95% confident about the correctness of the extracted information.
You can leverage this confidence level to establish a threshold for accepting or rejecting the extracted text. Setting a limit above 0.9 (or 90%) can help minimize errors in data processing.
Important Note: Attempting to set the value of Cell.confidence will throw a READ_ONLY error, as this property is not modifiable.
What Is Cell.text?
The Cell.text property provides the actual string content that was extracted from the respective cell in a document. This property is also read-only, and trying to assign a new value will result in a READ_ONLY error.
Syntax Example
Below is a sample code snippet demonstrating how to utilize the members of the Cell object within your SuiteScript code:
1// Add additional code2...3const extractedData = documentCapture.documentToStructure({4 file: file.load("SuiteScripts/sample_invoice.pdf"),5 documentType: documentCapture.DocumentType.INVOICE,6 features: [documentCapture.Feature.TABLE_EXTRACTION]7});8 9const cellToProcess = extractedData.pages[0].tables[0].bodyRows[0].cells[0];10if (cellToProcess.confidence > 0.9) {11 // Accept the cell text12} else {13 // Reject the cell text14}15...16// Add additional codeWho This Affects
- Developers: Engaged in building applications that utilize document capturing features.
- Administrators: Tasked with configuring and maintaining data processing strategies in NetSuite.
Key Takeaways
- The Cell Object in SuiteScript 2.1 provides confidence and text properties for document data handling.
Cell.confidenceis a score indicating the accuracy of extracted text.- Both properties are read-only and should be used in conditional checks.
Frequently Asked Questions (4)
What are the use cases for the Cell.confidence property in SuiteScript 2.1?
Can I modify the value of the Cell.confidence or Cell.text properties?
What script types support the Cell object in SuiteScript 2.1?
How should developers handle low confidence scores from the Cell object in NetSuite?
Was this article helpful?
More in SuiteScript
- Common SuiteScript Errors and Solutions for NetSuite
Common NetSuite script errors include INVALID_SCRIPT_DEPLOYMENT_ID and SSS_AUTHORIZATION_HEADER_NOT_ALLOWED. Learn effective solutions.
- Set Sublist Field Values in SuiteScript 2.x for Record Management
Set sublist field values in SuiteScript 2.x for effective record management using standard and dynamic modes.
- Setting Field Values in SuiteScript for Effective Record
Learn to set field values in SuiteScript effectively, troubleshooting common errors and understanding data types.
- SuiteScript 2.1 Enhancements and API Updates in NetSuite
SuiteScript 2.1 enables execution of 2.0 scripts and supports PATCH method for enhanced API capabilities.
Advertising
Reach SuiteScript Professionals
Put your product in front of NetSuite experts who work with SuiteScript every day.
Sponsor This Category