Transform (map) an array of collections

I have the following array of collections:

[
    {
        file: "https://link-to-file.com",
        name: "My file.png"
    },
    {
        file: "https://another file.com",
        name: "Another file.png"
    }
]

How can I transform it to:

[
    {
        url: "https://link-to-file.com",
        name: "My file.png"
    },
    {
        url: "https://another file.com",
        name: "Another file.png"
    }
]

As you can I just want to rename one of the keys. In JS I can achieve it very easily by using .map() function. How can I do the same using Make built-in functions?

Hi Mikolaj,

You can iterate your array using the iterator and then use the module “Aggregate to JSON”



1 Like