# 2. Field Mapping

Consulting the [documentation for the mock core](https://glyue.docs.sandboxbanking.com/~/changes/sRNNcOmmdTZIw2Ha7IFP/miscellaneous/sandbox-mock-core/dna-style-fields), we see there are 5 fields of interest to us:

* `Name.FirstName`
* `Name.LastName`
* `EmailAddresses.EmailAddress[0].ElectronicAddressLines.ElectronicAddressLine[0].AddrLine`
* `Identification.DateOfBirth`
* `PersTyps.PersTyp[0].PersonTypeCode`

Additionally, we'll need to add the `url_path` of the endpoint that we're calling on the Mock Core.

Right-click on the `create_new_customer` Service Request and select *Go To > Field Mapping*. Click *+ Add Row 6* times to create 6 empty field mappings.

<figure><img src="https://688288018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1flQ2To8tQpCQWl2Ty9U%2Fuploads%2Fe9I89IBDo0mT5c95qarK%2FScreenshot%202024-09-03%20at%2012.36.35%E2%80%AFPM.png?alt=media&#x26;token=0a3db222-9b02-4759-aed0-27d6a447dbf1" alt=""><figcaption><p>Five empty Field Mappings</p></figcaption></figure>

Each of the fields required by the core can be populated using data we received from randomuser.me, so we simply need to set up the mapping between the fields across the two systems.

First, we'll populate all the fields that the core expects. In the `field` column, copy in the following JSON paths:

| Field                                                                                     |
| ----------------------------------------------------------------------------------------- |
| `Name.FirstName`                                                                          |
| `Name.LastName`                                                                           |
| `EmailAddresses.EmailAddress[0].ElectronicAddressLines.ElectronicAddressLine[0].AddrLine` |
| `Identification.DateOfBirth`                                                              |
| `PersTyps.PersTyp[0].PersonTypeCode`                                                      |
| `url_path`                                                                                |

Now for each field that the core expects, we'll enter the JSON path to the value as it exists in the response from randomuser.me:

| Field                                                                                     | Value                                                  |
| ----------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| `Name.FirstName`                                                                          | `request_users.response.payload.results[0].name.first` |
| `Name.LastName`                                                                           | `request_users.response.payload.results[0].name.last`  |
| `EmailAddresses.EmailAddress[0].ElectronicAddressLines.ElectronicAddressLine[0].AddrLine` | `request_users.response.payload.results[0].email`      |
| `Identification.DateOfBirth`                                                              | `request_users.response.payload.results[0].dob.date`   |
| `PersTyps.PersTyp[0].PersonTypeCode`                                                      | `"individual"`                                         |
| `url_path`                                                                                | `"/api/integration/fiservdna/person_maintenance"`      |

Notice that while the first four items are JSON Paths into the object returned by `randomuser.me`, the last item is a static value, as it will always be the same for all users created by this integration.

Finally, fill out `str` for the Value Type column for all rows.

<figure><img src="https://688288018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1flQ2To8tQpCQWl2Ty9U%2Fuploads%2FW7TLbFEDBFZT5LUSYNx0%2FScreenshot%202025-02-25%20at%204.31.02%E2%80%AFPM.png?alt=media&#x26;token=b1611d59-6971-46ab-9d5d-ffe9c91cfd08" alt=""><figcaption><p>Five field mappings for the Service Request</p></figcaption></figure>

We have now transformed the data received from `randomuser.me` into the format that the mock banking core expects.&#x20;

Save your changes.
