# Set up mapping fields in FastStats

## Mapping the fields

To map Microsoft Dynamics fields in FastStats:

1. From **FastStats**, select **File** \> **Tools** \> **Administrative Functions** \> **Setup Microsoft Dynamics Fields**.

   [![Setup MS fields](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/Setup_MS_fields.png>)](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/Setup_MS_fields.png>)
2. The **Setup Microsoft Dynamics Fields** dialogue opens. Select **Add New Microsoft Dynamics Field**.

   [![Add new Microsoft Dynamics field](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/Add_new_MSD_fields.png>)](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/Add_new_MSD_fields.png>)
3. Enter the **Microsoft Dynamics Table Name**.
4. Enter the **Microsoft Dynamics Field Name**. This is the logical name of your column.
5. Select **Select** to choose the FastStats Unique Reference Number (URN) variable **Person URN** from the list under the **People Table**, then select **OK**.

   [![People table](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/People_table.png>)](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/People_table.png>)
6. Select **Codes or Descriptions** (depending on your variable) from the **Output Style** dropdown.
7. Select the **Key Field** check box to define this as the primary key field.

   > **Note**
   >
   > There must be one key field, or the upload won't work.

   [![Upload won't work](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/Upload_wont_work.png>)](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/Upload_wont_work.png>)
8. Select **OK**.
9. Repeat steps 2 to 8 for all the fields you created in Dynamics 365:

   - Map `new_fstitle` with FastStats **Title**: select **Descriptions**.

     [![Descriptions](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/Descriptions.png>)](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/Descriptions.png>)
   - Map `new_fsinitial` with FastStats **Initial**: select **Descriptions**.

     [![Initial descriptions](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/Initial_descriptions.png>)](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/Initial_descriptions.png>)
   - Map `new_fssurname` with FastStats **Surname**: select **Descriptions**.

     [![Surname description](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/Surname_description.png>)](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/Surname_description.png>)
   - Map `new_fsdob` with FastStats **DOB**: select **Descriptions**.

     [![DOB descriptions](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/DOB_descriptions.png>)](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/DOB_descriptions.png>)
   - Map `new_fsemail` with FastStats **Email Address**: select **Descriptions**.

     [![Email descriptions](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/Email_descriptions.png>)](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/Email_descriptions.png>)
10. Select **Close** to finish mapping fields.

    [![Close](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/Close.png>)](<https://help.apteco.com/assets/images/admin/integration/microsoft-dynamics-365/mapping-fields/Close.png>)

## Editing or deleting mappings

You can update or delete existing Microsoft Dynamics mapping fields:

- To update a mapping field, select **Edit**.
- To delete a mapping field, select **Delete**.

> [!NOTE]
>
> You need to exit FastStats and log in again for these changes to take effect.

See [Upsert to Dynamics 365 from FastStats](<https://help.apteco.com/en/admin/integration/microsoft-dynamics-365/upsert/index.md>).
