# How to Use the Visual Data Mapper (VDM)


The **Visual Data Mapper** (VDM) offers an intuitive UI to map your warehouse columns to specific destination fields. This is useful especially when mapping your warehouse data to custom fields defined in your destination.

{{< success >}}
To use this feature, set up a [Reverse ETL source]({{< ref "sources/reverse-etl" >}}) and then connect it to a [destination that supports VDM](#supported-destinations).
{{< /success >}}

## Supported destinations

RudderStack supports the Visual Data Mapper for the following destinations:

{{< destinations vdmsupport="yes" >}}

## Use Visual Data Mapper

{{< info >}}
By default, Visual Data Mapping is enabled for all the [supported destinations](#supported-destinations). Click the **Map with JSON** button to [configure the data mappings via JSON]({{< ref "data-pipelines/reverse-etl/developer-guides/json-data-mapping.md" >}}).
{{< /info >}}

1. Select the destination **Object** where you want to sync the data.

{{< warning >}}
Note that:

- RudderStack automatically loads all the relevant destination objects. If you have added a new destination object during this configuration process, click **Reload objects** to get all the latest objects.
- RudderStack **does not** support objects that do not have any fields or a unique user identifier.
{{< /warning >}}

{{< image src="images/data-pipelines/vdm-mapping-1.webp" alt="Select object" >}}

2. Select the [sync mode]({{< ref "data-pipelines/reverse-etl/developer-guides/sync-modes.md" >}}) that RudderStack uses to sync your data.

### Choose identifier

In the **Choose Identifier** section, choose a warehouse column and destination field to map your records from the source to the destination. You can choose any column from the dropdown that acts as a unique identifier.

{{< image src="images/data-pipelines/vdm-mapping-2.webp" alt="Choose idenfier" >}}

{{< warning >}}
The **Choose identifier** field must have unique values in order to successfully sync the data to the destination. The records containing duplicate identifier values will **not** sync. 

For example, if you have chosen `name` as the identifier and it contains more than one values like `Alex`, the duplicate records will fail to sync.
{{< /warning >}}

### Map fields

In this section, you can configure the specific source-destination field mappings.

1. Click the **Map another field** option. Select the **Destination field** from the dropdown. Then, select the **Warehouse column** you want to map to this field.

{{< image src="images/data-pipelines/vdm-mapping-3.webp" alt="Map objects" >}}

{{< success >}}
RudderStack gives you full visibility into the name and type of the fields that you are mapping along with a sample preview.
{{< /success >}}

#### **Mandatory mappings**

There are some required fields you need to map when sending events to some destination objects. These fields cannot be removed from the mappings. 

For example, in the Salesforce **Account** object, **Account Name** is a required field, as seen in the following image:

{{< image src="images/warehouse-actions-sources/vdm-5.webp" alt="Map another field" >}}

#### **Map fields of different type/format**

If you are mapping fields with different data types or formats, you can use the [Transformations]({{< ref "transformations/overview.md" >}}) feature to do the type conversion before sending the data. 

{{< image src="images/warehouse-actions-sources/vdm-6.webp" alt="Map another field" >}}

In the above example, RudderStack lets you map the warehouse column `PHONE` of string type to a destination field `Associated Company ID` of float data type.  You can then add a transformation at the destination end to do this type conversion to ensure there is no data type mismatch.

### Create custom destination fields

RudderStack lets you create a custom destination field and map it to a warehouse column.

1. Click the **Map another field** option. 
2. Enter the name of the custom destination field you want to create.
3. Click **Create**.

{{< info >}}
In some cases, you must create or define the custom fields in the destination **before** creating them in the RudderStack dashboard.
{{< /info >}}

{{< image src="images/data-pipelines/vdm-mapping-4.webp" alt="Create custom fields" >}}

#### **Sync data to custom Salesforce objects**

RudderStack **does not support** creating new custom fields for the [Salesforce]({{< ref "destinations/streaming-destinations/salesforce/" >}}) destination using the above steps. However, you can still use the Visual Data Mapper to sync your data to custom Salesforce objects by following these steps:

1. Log in to your [Salesforce dashboard](https://login.salesforce.com/?locale=in).
2. In the top navigation bar, click the **Setup** icon and go to **Object Manager**.

{{< image src="images/warehouse-actions-sources/salesforce-custom-object.webp" alt="Salesforce custom object" >}}

3. Go to **Create** > **Custom Object**.
4. Enter the relevant details and click **Save** to finish the configuration.

{{< warning >}}
Make sure to select the **Allow Search** setting under the **Search Status** section, as seen below. Otherwise, the custom object will **not** be visible in the RudderStack dashboard.

{{< figure src="images/warehouse-actions-sources/salesforce-custom-object-1.webp" alt="Salesforce custom object" >}}
{{< /warning >}}

5. In your RudderStack dashboard, click **Reload objects** under the **Object** field. Your newly created custom object should now be visible in this list. Select the object and map the relevant fields to sync your data.

{{< image src="images/data-pipelines/salesforce-custom-object.webp" alt="Create custom Salesforce fields" >}}

## Update mapping configuration

{{< info >}}
Note the following:

- You can update your mapping configuration irrespective of whether the connection is turned on or off.
- While updating the mapping configuration, you **cannot** change the **Object**, **Sync mode**, and **Choose identifier** fields. You will have to delete the destination and connect a new destination from scratch to do so.
{{< /info >}}

1. Go to the **Schema** tab of your Reverse ETL connection page.
2. Update the mappings as required.
3. Click **Save** to update the configuration.

{{< image src="images/retl-sources/update-vdm-mapping.webp" alt="Update JSON mappings" >}}

<br />
