06-13-2023 04:37 AM
HI experts,
I have this input and the array of EmailAdresses can consist of 1 - 5 addresses:
[
{
“BusinessPartner”:“10”,
“LastName”:“lam”,
“SearchTerm1”:“lam”,
“to_BusinessPartnerAddress”:{
“results”:[
{
“BusinessPartner”:“10”,
“Country”:“DE”,
“to_EmailAddress”:{
“results”:[
{
“EmailAddress”:[
“info@gmail.com”,
“test@gmail.com”
]
}
]
}
}
]
}
}
]
I want to accomplish this (get all the values from the array and put them below each other as strings):
[
{
“BusinessPartner”: “10”,
“LastName”: “testlastname”,
“SearchTerm1”: “lam”,
“to_BusinessPartnerAddress”: {
“results”: [
{
“BusinessPartner”: “10”,
“Country”: “DE”,
“to_EmailAddress”: {
“results”: [
{
“EmailAddress”: “info@gmail.com”
},
{
“EmailAddress”: “test@gmail.com”
}
]
}
}
]
}
}
]
How can I accompllish this I already tried to change it to an object, but I think it’s something with mapping.
Regards
Jens
Solved! Go to Solution.
06-13-2023 04:46 AM
Hi @JensDeveloper,
You can try by using Mapper Snap with the following settings:
Expression used:
jsonPath($, "$EmailAddress[*]").map(x => {"EmailAddress":x})
Let me know if this helps.
BR,
Aleksandar.
06-13-2023 04:46 AM
Hi @JensDeveloper,
You can try by using Mapper Snap with the following settings:
Expression used:
jsonPath($, "$EmailAddress[*]").map(x => {"EmailAddress":x})
Let me know if this helps.
BR,
Aleksandar.