# Script on nested fileds

**URL:** <https://discuss.elastic.co/t/script-on-nested-fileds/263389>\
**Category:** Kibana\
**Created:** [February 5, 2021, 1:42pm UTC](https://discuss.elastic.co/t/script-on-nested-fileds/263389 "2021-02-05T13:42:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giovanni\_Di\_Lembo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/giovanni_di_lembo/32/45714_2.png) [@Giovanni\_Di\_Lembo](https://discuss.elastic.co/u/Giovanni_Di_Lembo)\
**Post date:** [February 5, 2021, 1:42pm UTC](https://discuss.elastic.co/t/script-on-nested-fileds/263389/1 "2021-02-05T13:42:33Z")

</div>

hi all and sorry for my poor english .  
I have an index with this mapping

```
"mappings":{

    "properties":{

        "_class":{

        "type": "text",

        "fields":{"keyword":{"type": "keyword", "ignore_above": 256 }}

        },

        "my":{

           "type": "keyword" 

        },

        "notifications":{

            "type": "nested",

            "properties":{

                "detail":{"type": "keyword"},

                "identifier":{"type": "keyword"},

                "modelType":{"type": "keyword"},

                "notificationDate":{ "type": "long" } 

             }

    }

}

```

I'm creating a script on notificatioDate fields.  
But when I do doc['notifications.notificationDate'].value , kibana says me 'Script not valid' with no reason specified

Consider that it 's searchable and aggragatable.

---

<div class="post-metadata">

**Author:** ![Patrick\_Mueller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_mueller/32/109425_2.png) [@Patrick\_Mueller](https://discuss.elastic.co/u/Patrick_Mueller)\
**Post date:** [February 22, 2021, 2:18pm UTC](https://discuss.elastic.co/t/script-on-nested-fileds/263389/2 "2021-02-22T14:18:30Z")

</div>

Here's a Stack Overflow post on using `_source` instead of `doc` in the script: [elasticsearch - How to access nested property at script\_fields on elastic 5.x - Stack Overflow](https://stackoverflow.com/questions/41275228/how-to-access-nested-property-at-script-fields-on-elastic-5-x)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 22, 2021, 2:18pm UTC](https://discuss.elastic.co/t/script-on-nested-fileds/263389/3 "2021-03-22T14:18:40Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
