Forum Discussion

gowdhaman008's avatar
gowdhaman008
New Contributor II
7 years ago

Suppressing unwanted columns inside the Array

Hi,

I have following json data. It has array of map with 3 different columns in it.

Input:
[{
“Phone”: [{
“Phone”: “3333333333”,
“PhoneType”: “1”,
“DonotCall”: “Y”
},
{
“Phone”: “1234567890”,
“PhoneType”: “2”,
“DonotCall”: “N”
}]
}]

Expected Output:
[{
“Phone”: [{
“Phone”: “3333333333”,
“PhoneType”: “1”,
},
{
“Phone”: “1234567890”,
“PhoneType”: “”,
}]
}]

I wanted to suppress “DonotCall” column.

Can you please help me with what function I need to use in Mapper to achieve this?

Thanks,
Gowdhaman

1 Reply

  • slaytanic70's avatar
    slaytanic70
    New Contributor III

    Gowdhaman,

    In the MAPPER, add this to the left side:
    jsonPath($, “$Phone[*].DonotCall”)

    Also, to be safe, check the boxes for Null-Safe Access and Pass Through. Then you will get your desired result.