# Copyng extant array of values from a GET and appending one more for an HTTP PATCH

**URL:** <https://community.make.com/t/copyng-extant-array-of-values-from-a-get-and-appending-one-more-for-an-http-patch/46603>\
**Category:** Questions\
**Tags:** collections, arrays, api\
**Created:** [July 17, 2024, 11:44pm UTC](https://community.make.com/t/copyng-extant-array-of-values-from-a-get-and-appending-one-more-for-an-http-patch/46603 "2024-07-17T23:44:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mixelpix](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/mixelpix/32/521_2.png) [@mixelpix](https://community.make.com/u/mixelpix)\
**Post date:** [July 17, 2024, 11:44pm UTC](https://community.make.com/t/copyng-extant-array-of-values-from-a-get-and-appending-one-more-for-an-http-patch/46603/1 "2024-07-17T23:44:47Z")

</div>

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”:

```json
{
  "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:

```json
{
  "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](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 🙂

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [July 18, 2024, 2:29am UTC](https://community.make.com/t/copyng-extant-array-of-values-from-a-get-and-appending-one-more-for-an-http-patch/46603/2 "2024-07-18T02:29:28Z")

</div>

You can “Create” another “option item” collection quickly with the “Parse JSON” module:

```plaintext
{ "newItem": {
  "label": "new item",
  "value": "value",
  "displayOrder": "3",
  "hidden": false
}}

```

Then, you can add this item to your options array by using the built-in function `add`

e.g.:

```plaintext
{{ add(1.body.options; 2.newItem) }}

```

For more information, see the function documentation in the [Help Center](https://www.make.com/en/help).

[samliew](https://samliew.com/services) – [request private consultation](https://samliew.com/request-quote?ServiceType=Automation%20Consultation&Referrer=Make)

> Join the [Make Fans](https://samliew.com/make-discord-invite) Discord server to [chat](https://samliew.com/make-discord-invite) with other makers!

---

<div class="post-metadata">

**Author:** ![mixelpix](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/mixelpix/32/521_2.png) [@mixelpix](https://community.make.com/u/mixelpix)\
**Post date:** [July 18, 2024, 3:54pm UTC](https://community.make.com/t/copyng-extant-array-of-values-from-a-get-and-appending-one-more-for-an-http-patch/46603/3 "2024-07-18T15:54:53Z")

</div>

Thank you @samliew - works perfectly!

`{{add(1.body.options; 2.one_more_option)}}`

where 2.one\_more\_option is the key for an object matching the extant object structure.

```json
{"one_more_option": {
  "label": "test3",
  "value": "test3",
  "displayOrder": "4",
  "hidden": false}
}

```

---

<div class="post-metadata">

**Author:** ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)\
**Post date:** [August 1, 2024, 4:19pm UTC](https://community.make.com/t/copyng-extant-array-of-values-from-a-get-and-appending-one-more-for-an-http-patch/46603/4 "2024-08-01T16:19:03Z")

</div>


