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.
Source: This article is based on Oracle's official NetSuite documentation.
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 Platform
- Style Object Members for Workbook API in NetSuite
The Style object provides customizable properties for workbook formatting in NetSuite, enhancing report and visualization functionality.
- Search Filter Object Usage in SuiteScript
The Search Filter object enables refined query capabilities in SuiteScript, encapsulating search criteria.
- Setting Sublist Field Values in SuiteScript
Set values for sublist fields in SuiteScript using the setSublistValue method. Understand required parameters and error handling.
- Asynchronous HTTP Requests with SuiteScript Promises
Use SuiteScript to send asynchronous HTTP requests with promises for efficient error handling and response processing.
Advertising
Reach Platform Professionals
Put your product in front of NetSuite experts who work with Platform every day.
Sponsor This Category