โ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.