โ05-18-2022 05:32 PM
Hi,
the input is an array of numbers:
[โ324โ,โ1209โ,โ4849โ,โ2โ]
then i want to transform them into an array like below:
[
{โnumberโ:โ324โ},
{โnumberโ:โ1209โ},
{โnumberโ:โ4849โ},
{โnumberโ:โ2โ}
]
I tried reduce() and also tried convert it to an object and then replace the key, but seems no luck for both.
Can anyone help with this transformation? thanks!
โ05-18-2022 05:41 PM
Hi,
You can use this expression in a mapper:
["324","1209","4849","2"].map(val => {"number": val})
โ05-18-2022 07:33 PM
it works well! Thank you!
โ05-19-2022 07:20 PM
Hi @cjhoward18 ,
Thanks for the valuable suggestions, however, I need further help on the same lines:
I tried to use the same method in mapper snap which copied all node as is, How I can select a few of them. I need to have repetitive node โInvoiceLineโ and need to select few fields after group by and change the name. The repetitive nodes should be like below screen:
and Iโm using your suggestion as below screenshot:
Can you please suggest how to fix it?
Thanks,
Deepak Shaw.