# elementLabelProp - access nested property

**URL:** <https://jsonforms.discourse.group/t/elementlabelprop-access-nested-property/1150>\
**Category:** General\
**Created:** [November 25, 2022, 4:04pm UTC](https://jsonforms.discourse.group/t/elementlabelprop-access-nested-property/1150 "2022-11-25T16:04:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mynthon](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/mynthon/32/565_2.png) [@mynthon](https://jsonforms.discourse.group/u/mynthon)\
**Post date:** [November 25, 2022, 4:04pm UTC](https://jsonforms.discourse.group/t/elementlabelprop-access-nested-property/1150/1 "2022-11-25T16:04:32Z")

</div>

Hello,

When array uses non-primitives it renders as list of folded sections. Documentation says taht every section can be named with property by using “elementLabelProp” option.

> **[Controls - JSON Forms](https://jsonforms.io/docs/uischema/controls/#label-for-array-elements-elementlabelprop)**
>
> Controls generally represent properties declared in JSON Schema and serve to manipulate data.

[https://lodash.com/docs/4.17.15#get](https://lodash.com/docs/4.17.15#get)

But it is unclear for me how to acces property of nested element. For example if array contains nested objects like:

```auto
{
    "type": "object",
    "properties": {
        "nested1": {
            "type": "object",
            "properties": {
                "nested1-name": {
                    "type": "string"
                }
            }
        },
        "nested2": {
            "type": "object",
            "properties": {
                "nested2-2": {
                    "type": "object",
                    "properties": {
                        "nested2-2-name": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    }
}

```

How to access “nested2/nested2-2/nested2-2-name”? Please provide any tip.

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [November 25, 2022, 4:20pm UTC](https://jsonforms.discourse.group/t/elementlabelprop-access-nested-property/1150/2 "2022-11-25T16:20:08Z")

</div>

Hi @mynthon,

In React Material `nested2.nested2-2.nested2-2-name` should do the trick.

---

<div class="post-metadata">

**Author:** ![mynthon](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/mynthon/32/565_2.png) [@mynthon](https://jsonforms.discourse.group/u/mynthon)\
**Post date:** [November 25, 2022, 6:39pm UTC](https://jsonforms.discourse.group/t/elementlabelprop-access-nested-property/1150/3 "2022-11-25T18:39:38Z")

</div>

And in ui-schema path should start from “scope” or from “root”

```auto
{
    "type": "Categorization",
    "elements": [
        {
            "type": "Category",
            "elements": [
                {
                    "type": "Control",
                    "scope": "#/properties/sampleData",
                    "options": {
                        "showSortButtons": true,
                        "detail": {
                            "elementLabelProp": "nested2.nested2-2.nested2-2-name",
                            "type": "VerticalLayout",
                            "elements": [
                                {
                                    "type": "Control",
                                    "scope": "#/properties/nested1"
                                },
                                {
                                    "type": "Control",
                                    "scope": "#/properties/nested2"
                                }                              
                            ]
                        }
                    }
                }
            ]
        }
    ]
}

```

---

<div class="post-metadata">

**Author:** ![mynthon](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/mynthon/32/565_2.png) [@mynthon](https://jsonforms.discourse.group/u/mynthon)\
**Post date:** [November 28, 2022, 8:03am UTC](https://jsonforms.discourse.group/t/elementlabelprop-access-nested-property/1150/4 "2022-11-28T08:03:08Z")

</div>

Ok, I’ll will answer to myself. There is an error in my code and thats why it wouldn’t work.  
“elementLabelProp” address is relative to scope BUTproperty must be included inside “options” object, not inside “options.details”.
