Page Object Members for Document Capture in SuiteScript
Page Object Members enable efficient document classification, data extraction, and automation in SuiteScript.
The Page Object Members are part of the document capture functionality in SuiteScript. This feature facilitates the extraction of relevant information from documents, enhancing automation and processing accuracy.
What Are Page Object Members?
The Page Object Members in SuiteScript help developers extract vital data from uploaded documents, such as invoices or receipts. The main members include properties and methods that provide insights into the document content.
Key Properties and Methods
Here's a breakdown of the key properties and methods available in the Page Object:
| Member | Return Type | Description |
|---|---|---|
Page.detectedDocumentTypes | Object[] | Provides confidence levels indicating whether the page represents a specific document type. |
Page.fields | documentCapture.Field[] | Contains extracted fields from the document page. |
Page.lines | documentCapture.Line[] | Comprises extracted lines from the document page. |
Page.tables | documentCapture.Table[] | Includes extracted tables from the document page. |
Page.words | documentCapture.Word[] | Contains extracted individual words from the document page. |
Page.getText() | string | Returns the entire text of the page. |
Using Page Object Members
To utilize these members, ensure the relevant feature flags are enabled in your documentCapture.documentToStructure(options) call. This will allow you to extract desired fields based on your specific needs.
Example Syntax
The following code snippet demonstrates how to use the Page Object Members:
1const extractedData = documentCapture.documentToStructure({2 file: file.load("SuiteScripts/sample_invoice.pdf"),3 features: [4 documentCapture.Feature.FIELD_EXTRACTION,5 documentCapture.Feature.DOCUMENT_CLASSIFICATION6 ]7});8const pageDetectedDocumentTypes = extractedData.pages[0].detectedDocumentTypes;This simple setup lets you load a document and extract critical information, enhancing the overall productivity of your NetSuite instance.
Who This Affects
- Developers: They can leverage the Page Object Members to enhance document processing scripts.
- Administrators: Understanding these features helps in configuring document capture settings effectively.
Key Takeaways
- Page Object Members allow for efficient data extraction from documents.
- Key properties provide insights into document types, fields, lines, tables, and raw words.
- The
Page.getText()method offers a quick way to fetch all text content from a document page.
Frequently Asked Questions (4)
Do I need to enable a feature flag to use Page Object Members in SuiteScript?
How can developers extract specific document fields using SuiteScript's Page Object Members?
What data can be extracted using the Page Object Members in SuiteScript?
Are there any prerequisites for using document capture functionality with Page Object Members?
Was this article helpful?
More in SuiteScript
- Common SuiteScript Errors and Solutions for NetSuite
Common NetSuite script errors include INVALID_SCRIPT_DEPLOYMENT_ID and SSS_AUTHORIZATION_HEADER_NOT_ALLOWED. Learn effective solutions.
- Setting Field Values in SuiteScript for Effective Record
Learn to set field values in SuiteScript effectively, troubleshooting common errors and understanding data types.
- SuiteScript 2.1 Enhancements and API Updates in NetSuite
SuiteScript 2.1 enables execution of 2.0 scripts and supports PATCH method for enhanced API capabilities.
- Enhancements to SuiteScript User Role Context Clarification
SuiteScript updates clarify the user and role contexts for script executions, improving deployment understanding and management.
Advertising
Reach SuiteScript Professionals
Put your product in front of NetSuite experts who work with SuiteScript every day.
Sponsor This Category