# How to map a JSON payload in the SQL Server destination step

**URL:** <https://community.synatic.com/t/how-to-map-a-json-payload-in-the-sql-server-destination-step/414>\
**Category:** FAQs\
**Tags:** sql, mapping, json-payload\
**Created:** [April 2, 2024, 12:01pm UTC](https://community.synatic.com/t/how-to-map-a-json-payload-in-the-sql-server-destination-step/414 "2024-04-02T12:01:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![praise](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.synatic.com/praise/32/1124_2.png) [@praise](https://community.synatic.com/u/praise)\
**Post date:** [April 2, 2024, 12:01pm UTC](https://community.synatic.com/t/how-to-map-a-json-payload-in-the-sql-server-destination-step/414/1 "2024-04-02T12:01:08Z")

</div>

There are 2 ways to map a JSON payload in the SQL Server destination step which are the following:

The image below shows the SQL Server Destination step. The focus will be on the Column Mappings section as outlined.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/2X/1/1b05313d2c35454dff6897fed1ed1d5cc291c5ca.png)

## **1. Column Mappings Grid**

A JSON Payload can be mapped manually by typing the details in the Column Mappings grid.

To map a payload using the grid, click on the highlighted plus button in the page below.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/2X/a/a80b37beb0350be83b5e0c750e5f4039c1b7250b.png)

**Path** – The JSON Path to the value in the record.

**Column** – Name of the column to compare the value to.

**SQL Type** – [The SQL-defined type](https://www.w3schools.com/sql/sql_datatypes.asp). This is set to Varchar by default. Click on the highlighted drop-down arrow to choose from a list as shown in the image below.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/2X/9/926ad16140f5ad9a8e8b121e8f4bd2e2b6477d7a.png)

**Length** – Set the maximum character length. This is only used with Varchar, NVarachar and VarBinary SQL types.

**Precision** – Set the number of digits in a number.

**Scale** – Set the number of digits to the right of the decimal point in a number.

Once configured, click on the tick button highlighted in yellow on the far right of the row to add the buttons or click the (x) button to remove the mapping.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/2X/4/46bf528769a6686df10ddaa40f5930aef43a799d.png)

## **2. JSON code**

The JSON payload can be added manually by clicking on the code icon **(\</\>)** as highlighted in the below image.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/2X/5/539f2c24ea93751eb72ea9f15ec0d837b6595fa7.png)

The page below will open where the JavaScript code can be typed.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/2X/c/ce052b847e6f2e47f9ef356bef49e3646a84e6c2.png)

**NB** : [ChatGPT](https://chat.openai.com/) can be prompted to “Create a JSON payload with this structure for each field in this list”.
