documentCapture.parseResult(options)
The content in this help topic pertains to SuiteScript 2.1.
|
Method Description |
Converts a JSON file into a documentCapture.Document object. When you submit an asynchronous extraction request using the N/task module, the results are returned as a JSON object. You can save the results to a file in the NetSuite File Cabinet, then use this method to convert the results to a documentCapture.Document object for further processing or analysis. For an example of submitting an asynchronous extraction request, see Extract Content from a Document Asynchronously. |
|
Returns |
|
|
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
|
Governance |
None |
|
Module |
|
|
Since |
2025.2 |
Parameters
|
Parameter |
Type |
Required / Optional |
Description |
Since |
|---|---|---|---|---|
|
|
required |
The file to parse. This file must be located in the NetSuite File Cabinet and be in JSON format. |
2025.2 |
Errors
|
Error Code |
Thrown If |
|---|---|
|
|
The specified file is not a JSON file. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/documentCapture Module Script Samples.
// Add additional code
...
// '114' is the unique ID of the results file in the NetSuite File Cabinet
const fileObj = file.load(
id: '114'
);
const parsedResult = documentCapture.parseResult(fileObj);
const fullResultText = parsedResult.getText();
...
// Add additional code