Forum Discussion

Tommy's avatar
Tommy
New Contributor III
4 years ago
Solved

Checking for existence of an array in a mapper

Hello. Im looking for a way of dealing with JSON documents that are sometimes recognised as an array, and sometime not. In the below example, i need to manipulate the “message” element to remove cert...
  • Aleksandar_A's avatar
    3 years ago

    Hello and welcome @Senthilnaga91,

    You can achieve the needed transformations by using two Mapper Snaps like in the picture below.

    In the first Mapper we’re mapping the Account Details array:

    And, in the second one we’re mapping the Customer Entry object:

    Also you can refer to the sample pipeline attached below.

    sl-comm-nested-json-api_2023_05_30.slp (5.5 KB)

    Let me know if this helps you.

    Regards,
    Aleksandar.