โ03-23-2022 03:29 AM
Hi,
Iโm having it very difficult to fill the value of a key/value pair wit another value.
I Have an object that consists of a list of strings that are each unique. but with each string inside the object there is a value outside the object for each item in the list (The Value). The goal is to put for every item in the list of the object to change the value of a,b,c to the value of the key โValue1โ, โValue2โ See below
Before
[
{
โNameโ : {
โaโ : โaโ
},
โValue1โ : โrandomvalueโ
},
{
โNameโ : {
โbโ : โbโ
},
โValue2โ : โrandomValueโ
}
]
After
[
{
โNameโ : {
โaโ : โrandomvalue of Value1โ
},
โValue1โ : โrandomvalueโ
},
{
โNameโ : {
โbโ : โrandomvalue of Value2โ
},
โValue2โ : โrandomValueโ
}
]
If there is anything thatโs not understandable, let me know. Thanks in advance.
Solved! Go to Solution.
โ03-23-2022 03:44 AM
Hi @JensDeveloper,
Please try with the following expression in a Mapper snap and let me know if it helps you
$Name.mapValues(x=>$.entries()[1][1])
BR Aleksandar.
โ03-23-2022 03:44 AM
Hi @JensDeveloper,
Please try with the following expression in a Mapper snap and let me know if it helps you
$Name.mapValues(x=>$.entries()[1][1])
BR Aleksandar.
โ03-23-2022 03:58 AM
YES it works, wow!
Sorry but I was struggling a lot with language expressions and functions so I am Relieved. Thank you. I still need to learn a lot but I love it!