# JSONWriter nested array as objects

**URL:** <https://forum.cloverdx.com/t/jsonwriter-nested-array-as-objects/1546>\
**Category:** CloverDX Platform\
**Created:** [January 13, 2015, 12:00am UTC](https://forum.cloverdx.com/t/jsonwriter-nested-array-as-objects/1546 "2015-01-13T00:00:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matth](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@matth](https://forum.cloverdx.com/u/matth)\
**Post date:** [January 13, 2015, 12:00am UTC](https://forum.cloverdx.com/t/jsonwriter-nested-array-as-objects/1546/1 "2015-01-13T00:00:00Z")

</div>

Hello,

I’ve been familiarizing myself with the JSONWriter, Reader, and Extract components and am looking for some basic assistance in passing my metadata from a list container into a json object array.

My metadata:

```auto
secondary_type_id
[1024,3214,5323]

```

The json:

```auto
"types": {
             "primary_type": {
                 "id": 1180
             },
             "secondary_types": [
                 {
                     "type": {
                         "id": 2
                     },
                     "visible_boolean": true
                 }
             ]
         },

```

I’m able to pass the array nested under the object ID, but need each to be nested under an ID object. I’ve read through the JSONWriter docs and can’t figure it out still, any assistance would be appreciated! Looking for this:

```auto
"secondary_types": [
                 {
                     "type": {
                         "id": 3214
                     },
                     "visible_boolean": true
                 }
                 {
                     "type": {
                         "id": 1024
                     },
                     "visible_boolean": true
                 }
             ]

```

---

<div class="post-metadata">

**Author:** ![slechtaj](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@slechtaj](https://forum.cloverdx.com/u/slechtaj)\
**Post date:** [January 16, 2015, 2:46pm UTC](https://forum.cloverdx.com/t/jsonwriter-nested-array-as-objects/1546/2 "2015-01-16T14:46:00Z")

</div>

Hi Matth,

I’m not sure I got what you were saying. Could you please provide us with some sample source data and desired output data?

Thanks
