# Arrays in props.json - adding custom object to array, description for array properties

**URL:** <https://forum.inductiveautomation.com/t/arrays-in-props-json-adding-custom-object-to-array-description-for-array-properties/72518>\
**Category:** Module Development\
**Tags:** perspective\
**Created:** [April 17, 2023, 10:45am UTC](https://forum.inductiveautomation.com/t/arrays-in-props-json-adding-custom-object-to-array-description-for-array-properties/72518 "2023-04-17T10:45:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bjornar\_Alvestad](https://avatars.discourse-cdn.com/v4/letter/b/b38774/32.png) [@Bjornar\_Alvestad](https://forum.inductiveautomation.com/u/Bjornar_Alvestad)\
**Post date:** [April 17, 2023, 10:45am UTC](https://forum.inductiveautomation.com/t/arrays-in-props-json-adding-custom-object-to-array-description-for-array-properties/72518/1 "2023-04-17T10:45:21Z")

</div>

In the \*.props.json file I am able to add properties for objects that either show up as default or can be added from designer by pressing the `+` button. I can also add description to objects and primitive types inside the objects.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/0/f0590be75f601c15c3f97fb9f015b29a065cb607.png)

However for arrays containing objects, I have only been able to get them pre-filled by including entire array as `default`. For `properties` I have only been able to add empty arrays via the `+` button in the designer.

1. Is it possible to define `properties` that can get added inside array by pressing the `+` in the designer like we are able to do for other objects?

2. Is it possible to add descriptions to the parameters inside the array?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 17, 2023, 3:29pm UTC](https://forum.inductiveautomation.com/t/arrays-in-props-json-adding-custom-object-to-array-description-for-array-properties/72518/2 "2023-04-17T15:29:44Z")

</div>

The problem here is _probably_ our JSON editor not being 'smart' enough to recognize these situations and autocomplete accordingly. I don't think we have any e.g. Perspective components where this currently works (correct me if I'm wrong) so we would have to treat this as a feature request for the JSON editor.

---

<div class="post-metadata">

**Author:** ![haakon.soehoel](https://avatars.discourse-cdn.com/v4/letter/h/ebca7d/32.png) [@haakon.soehoel](https://forum.inductiveautomation.com/u/haakon.soehoel)\
**Post date:** [May 3, 2023, 1:24pm UTC](https://forum.inductiveautomation.com/t/arrays-in-props-json-adding-custom-object-to-array-description-for-array-properties/72518/3 "2023-05-03T13:24:52Z")

</div>

I think this is what you're looking for.  
Use the "items" keyword do define the properties of the array items:

```auto
"myArray": {
    "type": "array",
    "items": {
        "type": "object",
        "description": "Some description",
        "properties": {
            "label": {
                "type": "string",
                "description": "Some description",
                "default": "Label"
            },
            "value": {
                "type": "number",
                "description": "Some description",
                "default": 0
            }
        }
    },
    "description": "An array of values with label",
    "default": []
}

```
