> ## Documentation Index
> Fetch the complete documentation index at: https://docsv4.mile.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Connect a task type to the task list, routing, task times, data sources, extended data and the API.

The **Configuration** tab connects the task type to the rest of the app: what the task list shows, what routing reads, when tasks start and end, which records fill its fields, the extra fields your organization tracks, and how to create its tasks through the API. Setting it up well is what makes the task type work properly with tasks and routing.

<Note>
  Required permission:

  * View flow
  * Edit flow
</Note>

Open a task type and click the **Configuration** tab. Changes here are saved with **Save** at the bottom, like every other change to the task type.

<div align="center">
  <img src="https://mintcdn.com/mileappv4/Zv-R0yz4NrNyQHzp/images/v4/workflow/task-type-configuration.png?fit=max&auto=format&n=Zv-R0yz4NrNyQHzp&q=85&s=3ea922d7e37b678dd15104033b24198f" alt="Configuration tab" width="600" data-path="images/v4/workflow/task-type-configuration.png" />
</div>

1. **Configuration**: the tab with every section below, from top to bottom: **Task List**, **Route**, **Time**, **Extended data** and **API Example**.

Each row of Task List and Route picks one component. A component can only hold one role at a time: a component already used by another row is greyed out with **Already set as …**. The **×** beside a row clears it. A row with no suitable component says **No component can hold this.**

The same choices can be made from a component's own **Show As** and **Route As** settings in the [builder](/pages/workflow/task-type/builder#components).

## Task List

Task List decides how each task reads in the task list, on the web app and on the field app. For example, use the customer name as the title and the customer's address as the content.

<div align="center">
  <img src="https://mintcdn.com/mileappv4/Zv-R0yz4NrNyQHzp/images/v4/workflow/task-type-config-task-list.png?fit=max&auto=format&n=Zv-R0yz4NrNyQHzp&q=85&s=a00a988d494ef17924d3809eafb74c40" alt="Task List" width="600" data-path="images/v4/workflow/task-type-config-task-list.png" />
</div>

1. **Title**: the first, bold line of every task row, usually the customer name or an order ID.
2. **Content**: the second line, usually the address or a short description.
3. **Label**: a small tag under the content, usually a phone number, a label code or another short identifier.

Any Input (except a coordinate) or Select component, on any page, can be picked. Pick the components whose values tell tasks apart at a glance, so dispatchers can scan and assign without opening each task.

The same values show in the web app's task list. For example, with Customer Name as the title, Customer Address as the content and a parcel number as the label:

| Title | Content | Label |
| - | - | - |
| Budi Santoso | Jl. Kebon Jeruk No. 12, Jakarta Barat | 80 |
| Siti Rahmawati | Ruko Golden Boulevard Blok C-7, Tangerang | 71 |
| Andi Wijaya | Jl. Pemuda No. 45, Surabaya | 24 |

* **Title**: the value of the component mapped to Title, here the customer's name.
* **Content**: the value mapped to Content, here the delivery address.
* **Label**: the value mapped to Label, here the parcel number.

<Warning>
  If Title is empty, **Save** warns **Task Title Mapping Not Configured**, because task titles in the task list may be blank.
</Warning>

## Route

Route connects Initial page components to the fields of a **visit** in [Routing](/pages/planning/routing/visit), so tasks of this task type can be planned and optimized. Route is optional, but we strongly recommend at least **Visit Name**, **Address** and **Coordinate**. Without them routing still runs, but those values are not saved on the task's visit.

Only Initial page components can be picked, because routing reads the task as it was created. If the Initial page is turned off, Route says **Initial page is turned off for this task type. Route mapping is not available.**

<div align="center">
  <img src="https://mintcdn.com/mileappv4/Zv-R0yz4NrNyQHzp/images/v4/workflow/task-type-config-route.png?fit=max&auto=format&n=Zv-R0yz4NrNyQHzp&q=85&s=d340d1bcd28bdc545a7c231f57139fa3" alt="Route" width="600" data-path="images/v4/workflow/task-type-config-route.png" />
</div>

1. **Visit Name**: shown as the visit's **Name**. Only a **Text** input can be picked. If it is empty, the visit takes its name from the task list Title.
2. **Address**: shown as the visit's **Address**. A **Text** or **Address** input can be picked. If it is empty, the visit has no address and you type one for each visit by hand; **Save** also warns **Routing Address Mapping Not Configured**.
3. **Open Time**: the time window in which the visit should be done. Pick the component for the window's **Start Time** in the first box and its **End Time** in the second. Only **Time** inputs can be picked. **Add Open Time** adds another window, up to three (Open Time 1, 2 and 3); the bin removes one.
4. **Visit Duration**: shown as the visit's **Visit Time**, the minutes spent at the visit after arriving. Only a **Number** input can be picked, and its value must be a whole number because it is minutes.
5. **Coordinate**: shown as the visit's **Coordinate**. Only a **Coordinate** input can be picked. We recommend turning on geocoding for it so the visit lands in the right place on the map.
6. **Tag**: the visit's tags, used to match visits with vehicles or other criteria during optimization. A **Text** input or any **Select** can be picked.
7. **Grouped Visit**: visits with the same value are planned together. Only a **Text** input can be picked.
8. **Priority**: the priority of the visit group. Only a **Number** input can be picked.
9. **Constraint …**: one row for each capacity constraint set up in [Routing › Configuration](/pages/planning/routing/configuration/introduction), such as **Constraint weight**, **Constraint volume** or **Constraint width**. Only a **Number** or **Currency** input or select can be picked. The value is checked against each vehicle's capacity, and can have one decimal place.

The constraint rows depend on what your organization has set up; there can be up to 10 constraint types. For example:

| Row | Shown on the visit as | Typical value |
| - | - | - |
| Constraint weight | Weight | Total weight of the items, in kg |
| Constraint volume | Volume | Total volume of the items, in m³ |
| Constraint width | Width | Total width of the items, in m |

## Time

Time sets the default **start** and **end** of every task created from this task type, in whole hours.

<div align="center">
  <img src="https://mintcdn.com/mileappv4/Zv-R0yz4NrNyQHzp/images/v4/workflow/task-type-config-time.png?fit=max&auto=format&n=Zv-R0yz4NrNyQHzp&q=85&s=bb2e26a53fa35a6c3fdd1cf9b331de98" alt="Time" width="600" data-path="images/v4/workflow/task-type-config-time.png" />
</div>

1. **Start Time**: hours from when the task is created until it starts and shows to the assigned field worker. The default **0** means the task can be worked on right after it is created. Use, for example, **8** to show it only at the start of the next working day.
2. **End Time**: hours from the start until the task's deadline. The default **24** means the task expires one day after it starts. Use a smaller number for a tighter deadline.

<Note>
  These are defaults, filled in when each task is created. The person creating a task can still change its start and end time before saving it.
</Note>

## Data source

A component can fill itself, and other components, from records in [Data Source](/pages/workflow/data-source/introduction). When a field worker picks a record, such as a customer, store or product, the mapped fields fill in automatically, so nobody retypes information that already exists.

Only **Input**, **List** and **Bill** components can use a data source. The setting is in the component's own properties, not on the Configuration tab: select the component in the builder and turn on **Use data source**.

<Note>
  The data type and its records must exist before you can use them here. See [Data Type](/pages/workflow/data-type/introduction) and [Data Source](/pages/workflow/data-source/introduction).
</Note>

**When to use it**

* **Lookups of master data**: customers, stores, products, staff.
* **Fill several fields at once**: pick a customer once, and their phone number, address and coordinate fill in.
* **Consistent data**: field workers pick from a checked list instead of typing free text.

### Input

<div align="center">
  <img src="https://mintcdn.com/mileappv4/Zv-R0yz4NrNyQHzp/images/v4/workflow/task-type-data-source-input.png?fit=max&auto=format&n=Zv-R0yz4NrNyQHzp&q=85&s=e601f5eb118f471e8f467f675bb8ae1c" alt="Input data source" width="600" data-path="images/v4/workflow/task-type-data-source-input.png" />
</div>

1. **Use data source**: turn it on to show the Data Source settings below.
2. **Data Type**: the data type whose records are used, such as *Customer*.
3. **Search From Column**: the field of the record that people search or scan by. Typing or scanning into this component opens the list of matching records.
4. **Field Mappings**: each row fills one **Component** of this task type from one **Data field** of the picked record. Here, picking a customer fills Customer Address and Customer Coordinate.
5. **Add mapping**: add another row. The bin removes a row.

**Set up an Input data source**

1. Select the Input component in the builder and turn on **Use data source**.
2. In **Data Type**, pick the data type.
3. In **Search From Column**, pick the field people will search by.
4. Under **Field Mappings**, click **Add mapping** for each value to fill, and pick a **Data field** and the **Component** that receives it.
5. Click **Save**.

When a task is created, the person types or scans into the field, picks a record from the suggestions, and every mapped component fills from that record.

### List

A List can take its items from a data source, so the field worker picks products from a master list instead of typing each one. Two fields must be mapped:

| Mapped as | Shown in the list as | Data field type |
| - | - | - |
| **Item title** | The name of each row | Text |
| **Item quantity** | The quantity of that row | Number |

The data type needs at least one Text and one Number field.

**Set up a List data source**

1. Select the List component and turn on **Use data source**.
2. Pick the **Data Type** and the **Search From Column**.
3. Under **Field Mappings**, map **Item title** to a Text field and **Item quantity** to a Number field.
4. Click **Save**.

**Example: warehouse stock picking**

A warehouse operator runs a daily picking task. The List uses a *Product* data type:

| Field | Type | Example |
| - | - | - |
| SKU Code | Text | SKU-1042 |
| Product Name | Text | Mie Goreng 85g |
| Stock Available | Number | 250 |

* **Data Type**: Product
* **Search From Column**: SKU Code (the operator scans the barcode)
* **Item title**: Product Name
* **Item quantity**: Stock Available

On the field app the operator scans *SKU-1042*, and a row *Mie Goreng 85g* with quantity *250* is added. They change the quantity to what they actually picked, then scan the next SKU. Because every name comes from the master data, there are no typos like "mi goreng" to spoil the reports later.

Other uses: a sales rep picking products from the catalog for a call list, a technician confirming equipment at a site, or an auditor working through a fixed list of inspection items.

### Bill

A Bill works like a List with one more mapped field for the price. Three fields must be mapped:

| Mapped as | Shown on the bill as | Data field type |
| - | - | - |
| **Item name** | The name of each line | Text |
| **Item quantity** | The quantity of that line | Number |
| **Item price** | The unit price used for the total | Number |

The data type needs one Text and two Number fields. Discounts and extra costs are not read from the data source; set them on the Bill component itself. See [Bill](/pages/workflow/task-type/components/bill/introduction).

**Set up a Bill data source**

1. Select the Bill component and turn on **Use data source**.
2. Pick the **Data Type** and the **Search From Column**.
3. Under **Field Mappings**, map **Item name** to a Text field, and **Item quantity** and **Item price** to Number fields.
4. Optionally add the discounts and costs every bill should have.
5. Click **Save**.

**Example: retail sales order**

A sales rep writes an order at a store, with names and prices from the company price list. The *Product* data type has:

| Field | Type | Example |
| - | - | - |
| SKU Code | Text | SKU-1042 |
| Product Name | Text | Mie Goreng 85g |
| Default Qty | Number | 12 |
| Unit Price | Number | 3500 |

* **Search From Column**: SKU Code
* **Item name**: Product Name, **Item quantity**: Default Qty, **Item price**: Unit Price
* Costs on the Bill: a *Loyal Customer Discount* of 5,000 and a *Delivery Fee* of 15,000

The rep scans *SKU-1042*; a line *Mie Goreng 85g*, 12 × 3,500 = 42,000 is added. They change the quantity if needed. The total adds up every line, takes off the discount and adds the delivery fee. When the task is finished, the total and every line are saved on the task and included in exports.

Other uses: a technician picking repair services from a price list with a fixed call-out fee, a driver recording delivered menu items with a packaging charge, or an installer picking parts with labour added as a cost.

## Extended data

**Extended data** adds your own fields to the task type itself, such as a *Region* or a *Business Unit*, so you can record and report extra information about each task type. The same feature exists on hubs, users, roles and vehicles.

The first time, click **Setup extension**. It needs the **Create data type** permission; without it the section is hidden until someone sets it up.

<div align="center">
  <img src="https://mintcdn.com/mileappv4/Zv-R0yz4NrNyQHzp/images/v4/workflow/task-type-config-extension.png?fit=max&auto=format&n=Zv-R0yz4NrNyQHzp&q=85&s=fc7d20043f0691484b1f61070916a515" alt="Setup extension for Task Type" width="600" data-path="images/v4/workflow/task-type-config-extension.png" />
</div>

1. **Field title**: the name of the field, for example *Region*.
2. **Field type**: **Text**, **Number**, **Option**, **Multi option**, **Checkbox**, **Date**, **Date & time**, **Time**, **Coordinate** or **Phone number**. An option field asks for its options, one per line.
3. **Required**: whether every task type must have a value.
4. **Add field**: add another field. The bin removes one.

Click **Create**. The fields are shared by every task type in your organization, and each task type keeps its own values: fill them in on the Configuration tab and click **Save**. Later, **Add field** next to **Extended data** adds one more field (it needs the **View data type** and **Edit data type** permissions).

<Note>
  If the task type saves but its extended data does not, the app tells you so. Open Configuration again and save once more.
</Note>

## API Example

**API Example** shows how to create a task of this task type through the API: a ready-made request and a table of every field it takes.

<div align="center">
  <img src="https://mintcdn.com/mileappv4/Zv-R0yz4NrNyQHzp/images/v4/workflow/task-type-config-api.png?fit=max&auto=format&n=Zv-R0yz4NrNyQHzp&q=85&s=6f9acf1b62a71794b7237645f5a5dc5c" alt="API Example" width="600" data-path="images/v4/workflow/task-type-config-api.png" />
</div>

1. **Extended data**: the section above, with its **Setup extension** button.
2. **Copy CURL**: copy the example request to the clipboard. Replace `<token>` with your own [access token](/pages/account/access-token) before you run it.

The example request is built from the task type: it uses its name and one of your hubs, and fills each Initial page component with a sample value of the right type. Below it, the table lists every field:

| Field | Type | Description | Required |
| - | - | - | - |
| hubId | String | The hub the task belongs to. Use the hubs API to list hub IDs. | Required |
| flow | String | The name of the task type. | Required |
| startTime | Datetime | When the task starts. | Required |
| endTime | Datetime | When the task ends. | Required |
| customerName-1 | String | Follows the component's settings. | Optional |
| customerAddress | Address | Follows the component's settings. | Optional |
| customerCoordinate | Geolocation | Follows the component's settings. | Optional |
| orderPrice-1 | String | Follows the component's settings. | Optional |

* **Field**: the key to send. For components, it is the component's ID.
* **Type**: the kind of value the field takes, with its format and an example underneath.
* **Description**: what the field is for.
* **Required**: whether the request fails without it. A component marked **Required** in the builder is required here too.

<Tip>
  The request uses the task type's **name**. If you rename the task type, update the integrations that send it.
</Tip>

## Related

* [Task Type Builder](/pages/workflow/task-type/builder)
* [Routing › Visit](/pages/planning/routing/visit)
* [Data Source](/pages/workflow/data-source/introduction)
* [Create Task](/pages/activities/task/create-task)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.