cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting a json Object

dpan32
New Contributor II

Can anyone please help me to format the below json.
Source

Input:

sampledata : {

Key 1: Name,

Key2: John

},

{

Key 1: Name,

Key2: Simon

}

Output:

sampledata:{

Name: John

},

{

Name: Simon

}

Please let me know if there is any difficulty to understand the requirement.

2 REPLIES 2

Aleksandar_A
Contributor III

Try with the following Mapping in a Mapper Snap:

AleksandarAngel_0-1710333172027.png

Let me know if this helps you. 🙂

tlikarish
Employee
Employee

If you want something a tad more generic and you know that you'll always have a Key 1 and Key 2 field, then you could use an expression like this.

{[$["Key 1"]]: $["Key 2"]}