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.

·2 min read·View Oracle Docs

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 NameReturn TypeSupported Script TypesDescription
Cell.confidencenumberServer scriptsIndicates the confidence level of the extracted text.
Cell.textstringServer scriptsContains 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:

suitescript
1// Add additional code
2...
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 text
12} else {
13 // Reject the cell text
14}
15...
16// Add additional code

Who 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.confidence is 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?
The Cell.confidence property is used to gauge the accuracy of text extracted from document cells. Developers can set a threshold confidence level, such as above 0.9, to determine whether to accept or reject the extracted text, thus minimizing errors in processing.
Can I modify the value of the Cell.confidence or Cell.text properties?
No, both Cell.confidence and Cell.text properties are read-only. Attempting to change their values will result in a READ_ONLY error.
What script types support the Cell object in SuiteScript 2.1?
The Cell object is supported in server scripts within SuiteScript 2.1.
How should developers handle low confidence scores from the Cell object in NetSuite?
Developers should implement conditional checks based on confidence scores. If the Cell.confidence score is below the chosen threshold, such as 0.9, developers may choose to reject the extracted text to ensure data accuracy.
Source: Cell Object Members Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Platform

View all Platform articles →