# 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](https://clik-ai.gitbook.io/smart-extract-documentation/v4.0.3/smartextract-api#extracting-document-data) API call.

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

Please check [Initial Form Data Options](#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](https://clik-ai.gitbook.io/smart-extract-documentation/v4.0.3/smartextractsimple-api#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](#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](https://clik-ai.gitbook.io/smart-extract-documentation/v4.0.3/appendix#document-type) |
| assetType    | No       | string            | One of [Valid Asset types](https://clik-ai.gitbook.io/smart-extract-documentation/v4.0.3/appendix#asset-type)       |
| pageRange    | No       | \[number, number] | Page range to extract data for a pdf file                                                                           |
| osPeriod     | No       | \[Date, Date]     | Period range for operating statements                                                                               |
