Pre-Fillling Extraction Form

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 sendExtractDocumentRequest API call.

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

Please check Initial Form Data Options section below for more details

Using SmartExtractSimple API

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

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

Please check Initial Form Data Options section below for more details

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

Last updated