# Scripted field not working properly in ELK 7.2

**URL:** <https://discuss.elastic.co/t/scripted-field-not-working-properly-in-elk-7-2/188599>\
**Category:** Kibana\
**Created:** [July 3, 2019, 3:38am UTC](https://discuss.elastic.co/t/scripted-field-not-working-properly-in-elk-7-2/188599 "2019-07-03T03:38:18Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![dreamer1](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@dreamer1](https://discuss.elastic.co/u/dreamer1)\
**Post date:** [July 25, 2019, 9:05am UTC](https://discuss.elastic.co/t/scripted-field-not-working-properly-in-elk-7-2/188599/4 "2019-07-25T09:05:41Z")

</div>

Hi @mark.quilates,  
I have the same problem with ver. 6.3.0

> [@Scripted field: Read field data from a document using doc\[‘some\_field’\].value return null in some cases](https://discuss.elastic.co/t/scripted-field-read-field-data-from-a-document-using-doc-some-field-value-return-null-in-some-cases/187385):
>
> hi, on my document I have a field always populated. It's a string field and it can contains data like json or XML. I created this scripted field to find problem. def myField = doc['myfield'].value; if (payload != null){ return payload; } else{ return "payload is null"; } Now, in some cases I can see the payload data, but when I have an XML inside "myField", the scripted fields return "payload is null". I don't know the reason, it's unbelievable. Maybe the length of the string in XML…

They replied that it was a bug in 6.3.0 , but apparently it came back again in later versions(regression?).  
I'd like to know the "stable" version, and maybe before installing and configuring everything...

---

_[View the full topic](https://discuss.elastic.co/t/scripted-field-not-working-properly-in-elk-7-2/188599)._
