> For the complete documentation index, see [llms.txt](https://clik-ai.gitbook.io/smart-extract-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://clik-ai.gitbook.io/smart-extract-documentation/smart-extract.js/pre-filling-extraction-form.md).

# 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](/smart-extract-documentation/smart-extract.js/smartextract-api.md#extracting-document-data) API call.

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

Please check [Initial Form Data Options](/smart-extract-documentation/smart-extract.js/pre-filling-extraction-form.md#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](/smart-extract-documentation/smart-extract.js/smartextractsimple-api.md#extracting-document-data) API call.

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

Please check [Initial Form Data Options](/smart-extract-documentation/smart-extract.js/pre-filling-extraction-form.md#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            | One of [Valid Document Types](/smart-extract-documentation/appendix.md#document-type) |
| assetType    | No       | string            | One of [Valid Asset types](/smart-extract-documentation/appendix.md#asset-type)       |
| pageRange    | No       | \[number, number] | Page range to extract data for a pdf file                                             |
| osPeriod     | No       | \[Date, Date]     | Period range for operating statements                                                 |
