Transform arrays to objects

This article explains how you can change arrays to an array of objects

Let's say, you want to change the following data from arrays to objects:

{
"categories": [
"concrete",
"posts",
"system"
]
}

The obtained structure should be like these objects:

{
"categories": [
{
"name": "concrete"
},
{
"name": "posts"
},
{
"name": "system"
}
]
}

Setup the Transformer

  1. Create a new Transformer. Use Data, transform data using mappers and conditions
  2. Choose Move using a pattern
  3. Fill in the Pattern categories
  4. Fill in the Replacement result.categories.$1.name

And you're set!

Screenshot

Schermafbeelding 2021-01-14 om 17.21.57