# Make field script created to be keyword

**URL:** <https://discuss.elastic.co/t/make-field-script-created-to-be-keyword/161502>\
**Category:** Kibana\
**Tags:** painless\
**Created:** [December 19, 2018, 11:40am UTC](https://discuss.elastic.co/t/make-field-script-created-to-be-keyword/161502 "2018-12-19T11:40:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![moise](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@moise](https://discuss.elastic.co/u/moise)\
**Post date:** [December 19, 2018, 11:40am UTC](https://discuss.elastic.co/t/make-field-script-created-to-be-keyword/161502/1 "2018-12-19T11:40:30Z")

</div>

Hi, I have created a script field that returns a string. I made a graph and in filter part when I select the field it force me to tape a value or I want to have a select field to choose one of the returned values of my field created.

Thanks

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [December 19, 2018, 10:19pm UTC](https://discuss.elastic.co/t/make-field-script-created-to-be-keyword/161502/2 "2018-12-19T22:19:31Z")

</div>

Hello,

Scripted fields are operating as Kibana constructs. So graph doesn't access them. A field being a keyword is defined in elasticsearch with your mapping.

So you will have to figure out which field you want to use and make sure your mapping is correct.

Thanks,  
Bhavya

---

<div class="post-metadata">

**Author:** ![moise](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@moise](https://discuss.elastic.co/u/moise)\
**Post date:** [December 20, 2018, 7:53am UTC](https://discuss.elastic.co/t/make-field-script-created-to-be-keyword/161502/3 "2018-12-20T07:53:32Z")

</div>

Thanks bhavyarm

---

<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:** [January 17, 2019, 8:05am UTC](https://discuss.elastic.co/t/make-field-script-created-to-be-keyword/161502/4 "2019-01-17T08:05:47Z")

</div>

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