Forum Discussion

dpan32's avatar
dpan32
New Contributor II
2 years ago

Formatting a json Object

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

  • Try with the following Mapping in a Mapper Snap:

    Let me know if this helps you. 🙂

  • 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"]}