# Script with null field

**URL:** <https://discuss.elastic.co/t/script-with-null-field/4819>\
**Category:** Elasticsearch\
**Created:** [July 8, 2011, 7:13am UTC](https://discuss.elastic.co/t/script-with-null-field/4819 "2011-07-08T07:13:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [July 8, 2011, 7:13am UTC](https://discuss.elastic.co/t/script-with-null-field/4819/1 "2011-07-08T07:13:27Z")

</div>

Hi.  
I want to write a script which first sees if a particular field is  
null or not and then performs action like if else.  
I have written my script and I think it is failing to check if the  
field is present or not.  
Can anybody check if that is the problem and if yes how to solve it?  
My code is at git://gist.github.com/1071290.git.

Regards.

---

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [July 8, 2011, 8:39am UTC](https://discuss.elastic.co/t/script-with-null-field/4819/2 "2011-07-08T08:39:47Z")

</div>

Ok. Issue resolved.

On Jul 8, 12:13 pm, nachiket bhagwat [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)  
wrote:

> Hi.  
> I want to write a script which first sees if a particular field is  
> null or not and then performs action like if else.  
> I have written my script and I think it is failing to check if the  
> field is present or not.  
> Can anybody check if that is the problem and if yes how to solve it?  
> My code is at git://gist.github.com/1071290.git.
> 
> Regards.

---

<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:** [July 6, 2017, 4:01am UTC](https://discuss.elastic.co/t/script-with-null-field/4819/3 "2017-07-06T04:01:18Z")

</div>


