Table Object Members Reference for SuiteScript 2.1

Table Object Members in SuiteScript 2.1 provide essential properties for document table data extraction.

·3 min read·View Oracle Docs

The Table Object Members in SuiteScript 2.1 facilitate the effective extraction of table-related data from documents. This feature is particularly useful for developers working with document processing tasks, allowing for the dynamic retrieval of body rows, headers, and footers from various file types.

Overview of Table Object Members

All the members in the Table Object provide valuable insights regarding the extracted data from tables in a document. Here's a detailed list of the properties available:

Property NameReturn Type / Value TypeSupported Script TypesDescription
Table.bodyRows[documentCapture.TableRow][]Server scriptsThe extracted body rows from the table in a document.
Table.columnCountnumberServer scriptsThe number of extracted columns from the table.
Table.confidencenumberServer scriptsThe confidence level for the table extraction.
Table.footerRows[documentCapture.TableRow][]Server scriptsThe extracted footer rows from the table.
Table.headerRows[documentCapture.TableRow][]Server scriptsThe extracted header rows from the table.
Table.rowCountnumberServer scriptsThe number of extracted rows from the table.

Description of Properties

  • Table.bodyRows: This property holds the main content rows of the table, excluding any header or footer rows. It returns an array of documentCapture.TableRow objects, allowing access to each row's cell data.
  • Table.columnCount: A count of the columns extracted from the document's table, aiding in understanding the structure of the data.
  • Table.confidence: This numerical value reflects the certainty of the extracted table's accuracy, which can be beneficial when assessing the reliability of the data.
  • Table.footerRows: Similar to body rows, this property captures any rows that appear at the bottom of the table, typically used for summaries or totals.
  • Table.headerRows: It extracts the rows that constitute the header of the table, providing essential labeling for data columns.
  • Table.rowCount: A simple count of how many rows are present in the table for quick reference.

Example Usage

Here is a syntax example demonstrating the usage of the Table Object within SuiteScript:

suitescript
1// Add additional code
2...
3
4const extractedData = documentCapture.documentToStructure({
5 file: file.load("SuiteScripts/sample_invoice.pdf"),
6 documentType: documentCapture.DocumentType.INVOICE,
7 features: [documentCapture.Feature.TABLE_EXTRACTION]
8});
9
10const tableBodyRows = extractedData.pages[0].tables[0].bodyRows;
11
12...
13// Add additional code

Key Considerations

  • It is noteworthy that errors may arise when attempting to assign values to read-only properties, as indicated by the READ_ONLY error code. Understanding these nuances will aid in effective script development.

Source: This article is based on Oracle's official NetSuite documentation.

Key Takeaways

  • The Table Object Members provide essential properties for manipulating table data extracted from documents.
  • Each property allows developers to access specific aspects of table data, enhancing script capabilities.
  • Understanding these members is crucial when implementing table data extraction in SuiteScript 2.1.

Frequently Asked Questions (4)

What types of scripts are supported by Table Object Members in SuiteScript 2.1?
Table Object Members are supported in server scripts within SuiteScript 2.1.
How can I access the main content rows of a table using SuiteScript 2.1?
You can access the main content rows of a table by using the 'Table.bodyRows' property, which returns an array of 'documentCapture.TableRow' objects.
Is it possible to modify the properties of Table Object Members once they are extracted?
No, attempting to modify the properties of Table Object Members could result in errors, as indicated by the 'READ_ONLY' error code.
How can I evaluate the accuracy of the extracted table data in SuiteScript 2.1?
The 'Table.confidence' property provides a numerical value that reflects the certainty of the table's extraction accuracy.
Source: Table 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 Integration

View all Integration articles →