How do I do this in Make?
I query a service (e.g. Hubspot via an API module) and an object is returned. From i.e. {{1.body.properties}} - an array of objects - I would like to copy the existing objects, and add one more.
e.g. three existing objects in an arrray with the key: “options”:
{
"body": {
...
"options": [
{0...},
{1...},
{2...}
],
...
}
"headers": {..}
"status code": 200
}
… and I would like to transform that into just an object with the three properties plus one more:
{
"options": [
{
"label": "pending",
"value": "pending",
"displayOrder": "0",
"hidden": false
},
{
"label": "active",
"value": "active",
"displayOrder": "1",
"hidden": false
},
{
"label": "other",
"value": "other",
"displayOrder": "2",
"hidden": false
},
{
"label": "test2",
"value": "test2",
"displayOrder": "3",
"hidden": false
}
]
}
I’m at a loss between aggregators and array functions and am realizing I don’t quite understand bundles and collections.
Ultimately I would like to pass the appended array of objects as the body of an API call to e.g. https://api.hubapi.com/crm/v3/properties/deals/user_status?archived=false
Context: essentially I am trying to construct a pattern whereby I can add new (i.e. unrecognized) values for the user_status to a list of options for a single-select “dropdown menu” property in Hubspot.
Thanks ![]()