# Extraction fields

Extraction fields are used to define which data to extract from documents.\
To ensure consistent training and data extraction, Typless uses 3 different field data types.

## Supplier field

{% hint style="info" %}
📘 <mark style="color:blue;">**Every document type will always have a supplier\_name field**</mark>

It is the only required data value you need to send when you train your documents.
{% endhint %}

Every document type will always have a field **supplier\_name**.\
When training, the value of this field **must be** the name of your **supplier** who issued the document.

## String type

The string field type is used for general string fields like **document numbers, addresses, company names, payment references, IBANs, ...**

| Value Standard                                | Behaviour                                | Training - Response format        |
| --------------------------------------------- | ---------------------------------------- | --------------------------------- |
| Any string of characters written on document. | It returns string value read by the OCR. | Any sequence of up 250 characters |

### Examples

| Value on document         | Returned value      | Value for training  |
| ------------------------- | ------------------- | ------------------- |
| Invoice number 123-55ABCD | 123-55ABCD          | 123-55ABCD          |
| city 369, street 42       | city 359, street 42 | city 369, street 42 |

As you can see from the examples, you can extract full strings or just parts to get the value that you want.

## Number type

The number field type is used for numbers you want to perform calculations with, like **total amount, net amount, ...**

| Value standard                                                     | Behaviour                                                           | Training - Response format                                                 |
| ------------------------------------------------------------------ | ------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| Number written in many different decimal and thousands separators. | Always returns numbers as float string rounded to 4 decimal places. | Any float or integer with a single . Separator and up to 4 decimal points. |

### Examples

| Value on document | Returned value | Value for training |
| ----------------- | -------------- | ------------------ |
| 1.1               | 1.1000         | 1.1000             |
| 1"234.12          | 1234.1200      | 1234.1200          |
| 1,000.2345        | 1000.2345      | 1000.2345          |
| 12                | 12.0000        | 12.0000            |

## Date type

The date field type is used for dates like **issue date, pay due, date of service, delivery date, contract date, ...**

| Value Standard                                  | Behaviour                                                 | Training - Response format                                                                               |
| ----------------------------------------------- | --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| Date written in 100+ languages and 50+ formats. | It captures only date information without the time stamp. | <p>String in <strong>ISO 8601</strong> format <strong>YYYY-MM-DD</strong><br>For example 2020-01-01.</p> |

### Examples

| Value on document | Returned value | Value for training |
| ----------------- | -------------- | ------------------ |
| 1.1.21            | 2021-01-01     | 2021-01-01         |
| 10 Jan 2021       | 2021-01-10     | 2021-01-10         |
| 10/31/2021        | 2021-10-31     | 2021-10-31         |
| February 4, 2021  | 2021-02-04     | 2021-02-04         |

Typless will figure out which format the date is written in your documents and return the correct value in the standard ISO 8601 format.

## Constant type

The constant field type is used for fields like **currency, unit**...\
When a piece of information related to the supplier is always the same, you can use a constant field type.

{% hint style="warning" %} <mark style="color:orange;">**🚧 Only metadata fields support constant type**</mark>

It is not possible to use a constant type on the line items fields.
{% endhint %}

| Value Standard                                                   | Behaviour                                                                                                                                                                            | Training - Response format            |
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------- |
| Any string of characters. String doesn't have to be on document. | It returns the same string value that was used during training. If different values were used for different documents during training, it returns the most frequently trained value. | Any sequence of up to 250 characters. |

### Examples

{% hint style="info" %}
📘 <mark style="color:blue;">**Value doesn't have to be on the document.**</mark>

The returned value is not dependent on any value from the document. The returned value is the same as the value used for training.
{% endhint %}

| Value on document | Returned value | Value for training |
| ----------------- | -------------- | ------------------ |
| /                 | USD            | USD                |
| /                 | km             | km                 |
| /                 | 2021-01-10     | 2021-01-10         |
