- Help Center
- Working with the iPaaS
- Best Practices
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
- Create a new Transformer. Use Data, transform data using mappers and conditions
- Choose Move using a pattern
- Fill in the Pattern categories
- Fill in the Replacement result.categories.$1.name
And you're set!