TableRow Object Members for SuiteScript 2.1 Development

The TableRow object in SuiteScript 2.1 provides access to extracted table cells for document processing, crucial for data retrieval.

·2 min read·View Oracle Docs

The TableRow object is essential for developers working with document processing in SuiteScript 2.1. This object allows access to the cells extracted from tables in processed documents, enabling effective handling of structured data.

Overview of TableRow Object Members

The TableRow object includes the following member:

Member NameReturn TypeSupported Script TypesDescription
TableRow.cellsdocumentCapture.Cell[]Server scriptsThe extracted cells in the table row.

Property Description

  • TableRow.cells: This property returns an array of documentCapture.Cell objects, which represent the individual cells extracted from the corresponding table row. These cells contain data retrieved from documents like invoices and reports.

Errors

  • Error Code: READ_ONLY
    • Thrown If: You attempt to set the value of this property, as it is read-only.

Example Syntax

To illustrate how the TableRow may be utilized within your SuiteScript, consider the following snippet:

suitescript
1// Sample SuiteScript code to extract table row data
2const extractedData = documentCapture.documentToStructure({
3 file: file.load("SuiteScripts/sample_invoice.pdf"),
4 documentType: documentCapture.DocumentType.INVOICE,
5 features: [documentCapture.Feature.TABLE_EXTRACTION]
6});
7
8const tableRowCells = extractedData.pages[0].tables[0].bodyRows[0].cells;
9// Further processing on tableRowCells can be executed here

This example demonstrates loading a document and extracting its structure, focusing on retrieving data from a specific table row.

Related Concepts

  • For further understanding, refer to the N/documentCapture Module which encompasses related functionalities and methods for effective document processing.

Who This Affects

This information is relevant for:

  • Developers: Those implementing solutions utilizing document extraction features.
  • Administrators: Those overseeing script deployment and server-side scripting solutions.

By leveraging the TableRow object in your SuiteScript 2.1 workflows, you can efficiently work with structured documents and enhance your application's data processing capabilities.


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

Key Takeaways

  • The TableRow object provides access to table cells in extracted documents.
  • The property TableRow.cells returns an array of documentCapture.Cell objects.
  • Attempting to modify the cells property will raise a READ_ONLY error.
  • This feature is primarily impactful for developers working on document processing scripts.

Frequently Asked Questions (4)

What script types support the TableRow object in SuiteScript 2.1?
The TableRow object is supported in server scripts within SuiteScript 2.1.
Can I modify the cells in a TableRow object within my SuiteScript?
No, you cannot modify the cells in a TableRow object as it is a read-only property. Attempting to do so will result in a 'READ_ONLY' error.
How does the TableRow object work with the documentCapture module?
The TableRow object works in conjunction with the documentCapture module by providing access to the individual cells extracted from tables in documents, such as invoices and reports.
Are there any prerequisites for using the TableRow object in SuiteScript 2.1?
To use the TableRow object effectively, you need to utilize the documentCapture module, which includes features like table extraction for document processing.
Source: TableRow 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 →