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
- 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.
