# Mailchimp tags from an array of objects?

**URL:** <https://community.make.com/t/mailchimp-tags-from-an-array-of-objects/6336>\
**Category:** Questions\
**Tags:** mailchimp\
**Created:** [January 4, 2023, 6:14pm UTC](https://community.make.com/t/mailchimp-tags-from-an-array-of-objects/6336 "2023-01-04T18:14:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CharlesHacks](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/charleshacks/32/6172_2.png) [@CharlesHacks](https://community.make.com/u/CharlesHacks)\
**Post date:** [January 4, 2023, 6:14pm UTC](https://community.make.com/t/mailchimp-tags-from-an-array-of-objects/6336/1 "2023-01-04T18:14:54Z")

</div>

Hey all,

I have an array of objects and I’m trying to extract the name field of each object and use it to add a tag to a Mailchimp subscriber. My data structure is below:

![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/e/e7b999fa847b14da6e1a4b798b0b79e659652808.png)

Two questions;

- I’m assuming that I need to set the “Tag” field for Mailchimp to map? And that is expecting a JSON object like so `[{"name":"tagname", "value": "active"}]`?

- How would I transform my products array into that format? I’ve figured out how I can get a simple array of names, but I can’t figure out how to turn that into an array of objects with a distinct key/value (“value” = “active”, always.)

Thank you!

---

<div class="post-metadata">

**Author:** ![Bjorn.drivn](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/bjorn.drivn/32/4503_2.png) [@Bjorn.drivn](https://community.make.com/u/Bjorn.drivn)\
**Post date:** [January 8, 2023, 11:33am UTC](https://community.make.com/t/mailchimp-tags-from-an-array-of-objects/6336/2 "2023-01-08T11:33:19Z")

</div>

HI @CharlesHacks

> [@CharlesHacks](#):
>
> - I’m assuming that I need to set the “Tag” field for Mailchimp to map? And that is expecting a JSON object like so `[{"name":"tagname", "value": "active"}]`?

Depends on your API call and what this expects. I would personally think it would just expect a list of tags seperated by comma or in an array; however I recommend you test this out.

> [@CharlesHacks](#):
>
> - How would I transform my products array into that format? I’ve figured out how I can get a simple array of names, but I can’t figure out how to turn that into an array of objects with a distinct key/value (“value” = “active”, always.)

You can use the “JSON” module for this. Use an iterator to go over your arrary, then an “Aggregate to JSON” module to add it all up in the structure you want.

Happy coding!

---

<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:** [September 7, 2023, 3:20pm UTC](https://community.make.com/t/mailchimp-tags-from-an-array-of-objects/6336/3 "2023-09-07T15:20:07Z")

</div>


