# Script Field is a list of nested values

**URL:** <https://discuss.elastic.co/t/script-field-is-a-list-of-nested-values/230414>\
**Category:** Elasticsearch\
**Created:** [April 29, 2020, 5:44pm UTC](https://discuss.elastic.co/t/script-field-is-a-list-of-nested-values/230414 "2020-04-29T17:44:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Orson\_Duque](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/orson_duque/32/67381_2.png) [@Orson\_Duque](https://discuss.elastic.co/u/Orson_Duque)\
**Post date:** [April 29, 2020, 5:44pm UTC](https://discuss.elastic.co/t/script-field-is-a-list-of-nested-values/230414/1 "2020-04-29T17:44:23Z")

</div>

Hello, I am new to this ES world and I honestly find it very interesting. I have a problem with fields generated or calculated from others.  
Let's say I have a movie and each movie has a list of participants. And said participant has an associated person, and a list of roles. I need a calculated field that returns the people who have the director role.  
Something like this because I have erased the rest of the fields:

```auto
{
	"film": {
		"mappings": {
			"film": {
				"properties": {
				   	"participations": {
						"type": "nested",
						"include_in_parent": true,
						"properties": {
							"person": {
								"type": "nested",
								"include_in_parent": true,
								"properties": {
									"birthDate": {
										"type": "date",
										"format": "strict_date_optional_time||epoch_millis"
									},
									"name": {
										"type": "string"
									},
									"path": {
										"type": "string"
									},
									"promotionalText": {
										"type": "string"
									},
									"realName": {
										"type": "string"
									},
									"sex": {
										"type": "string"
									},
									"slug": {
										"type": "string"
									},
									"status": {
										"type": "string"
									}
								}
							},
							"roles": {
								"type": "nested",
								"include_in_parent": true
							}
						}
				
				}
			}
		}
	}
}
}

```

---

<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:** [May 27, 2020, 5:44pm UTC](https://discuss.elastic.co/t/script-field-is-a-list-of-nested-values/230414/2 "2020-05-27T17:44:28Z")

</div>

Closed on May 27, 2020, 5:44pm UTC

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