# Can we access a scripted field with a scripted field

**URL:** <https://discuss.elastic.co/t/can-we-access-a-scripted-field-with-a-scripted-field/263388>\
**Category:** Kibana\
**Created:** [February 5, 2021, 1:36pm UTC](https://discuss.elastic.co/t/can-we-access-a-scripted-field-with-a-scripted-field/263388 "2021-02-05T13:36:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anjana1](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@anjana1](https://discuss.elastic.co/u/anjana1)\
**Post date:** [February 5, 2021, 1:36pm UTC](https://discuss.elastic.co/t/can-we-access-a-scripted-field-with-a-scripted-field/263388/1 "2021-02-05T13:36:58Z")

</div>

Kibana version : 7.9

Elasticsearch version : 7.9

APM Server version : 7.9

APM Agent language and version : java 1.8

Fresh install or upgraded from other version? fresh install

Is there anything special in your setup? For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc. :-no

I have to create a scripted field and need to access another scripted field from the newly created scripted field. I tried doc['scriptedfield'] and it doesnt seem to work.

How else can I access it ?

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [February 5, 2021, 2:19pm UTC](https://discuss.elastic.co/t/can-we-access-a-scripted-field-with-a-scripted-field/263388/2 "2021-02-05T14:19:05Z")

</div>

Just tested and I couldn't either which makes sense because scripted fields are generated as they are being used.

Why not just recreate the functionality in scripted field # 2 that you do in scripted field #1 and then add on your additional requirements? It's not the most effective solution but will work.

---

<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 5, 2021, 2:19pm UTC](https://discuss.elastic.co/t/can-we-access-a-scripted-field-with-a-scripted-field/263388/3 "2021-03-05T14:19:58Z")

</div>

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