smart-extract-documentation
v4.1.1
v4.1.1
  • SmartExtract
  • API Reference
    • Data Extraction API
      • Authentication
      • SmartExtract JSON API
    • Admin API
      • API Key Management
      • Extraction Logs API
  • smart-extract.js
    • Integration Overview
    • SmartExtract API
    • SmartExtractSimple API
    • Styling and Customisations
    • Pre-Fillling Extraction Form
    • Performing Multiple Extraction
    • Code Examples
      • SmartExtract API Examples
      • SmartExtractSimple API Examples
  • Appendix
Powered by GitBook
On this page
  • Using SmartExtract API
  • Using SmartExtractSimple API
  • Initial Form Data Options
  1. smart-extract.js

Pre-Fillling Extraction Form

PreviousStyling and CustomisationsNextPerforming Multiple Extraction

Last updated 2 years ago

The SmartExtract component shows an extraction form to collect required details from the user to correctly extract data from the document. At times you might already have this information present in the client application. To save users from re-filling or incorrectly filling this information you can pass data to be pre-filled in the data extraction form.

Using SmartExtract API

With SmartExtract API you can pass the initial form data with the API call.

smex.sendExtractDocumentRequest({
  file,
  fileName,
  data: {
    documentType,
    assetType,
    osPeriod,
    pageRange,
  },
})

Please check section below for more details

Using SmartExtractSimple API

With SmartExtractSimple API you can pass the initial form data with the API call.

const data = await smex.extractDocumentData({
  session: {...},
  file: fileDataUrl,
  fileName: file.name,
  data: {
    documentType,
    assetType,
    osPeriod,
    pageRange,
  },
});

Initial Form Data Options

Following are the possible values that can be passed as part of the data object to pre-fill the extraction form:

Parameter

Required

Type

Description

documentType

No

string

assetType

No

string

pageRange

No

[number, number]

Page range to extract data for a pdf file

osPeriod

No

[Date, Date]

Period range for operating statements

Please check section below for more details

One of

One of

sendExtractDocumentRequest
Initial Form Data Options
extractDocumentData
Initial Form Data Options
Valid Document Types
Valid Asset types