# Firebase testing for a null response for a key search help please

**URL:** https://community.thunkable.com/t/firebase-testing-for-a-null-response-for-a-key-search-help-please/101771
**Category:** Questions about Thunkable X
**Tags:** firebase
**Created:** [June 11, 2019, 3:37pm UTC](https://community.thunkable.com/t/firebase-testing-for-a-null-response-for-a-key-search-help-please/101771 "2019-06-11T15:37:59Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Pete\_Marsh](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@Pete\_Marsh](https://community.thunkable.com/u/Pete_Marsh)
#### Post date: [June 11, 2019, 3:37pm UTC](https://community.thunkable.com/t/firebase-testing-for-a-null-response-for-a-key-search-help-please/101771/1 "2019-06-11T15:37:59Z")

</div>

Hi Thunkers, can I pick the collective brainstem. I am trying to check if a key exists on firebase, if not receive the response and process add a new key.

The response I am getting is a “null” in the returned value block, I kinda expected a error code in the error block but that did not provide anything. My question is how to I test for “null” in the value block. I have tried NOT NULL blocks and tried text comparisons, but nothing seems to work.

Appreciate your thoughts on this.

Pete

---

<div class="post-metadata">

### Author: ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)
#### Post date: [June 11, 2019, 3:59pm UTC](https://community.thunkable.com/t/firebase-testing-for-a-null-response-for-a-key-search-help-please/101771/2 "2019-06-11T15:59:24Z")

</div>

Hey @Pete_Marsh,

I’m open to correction on this, but the last time I tried doing something like this I actually used a string “null” rather than the null block itself.

Give it a go and see how you get on.

---

<div class="post-metadata">

### Author: ![Pete\_Marsh](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@Pete\_Marsh](https://community.thunkable.com/u/Pete_Marsh)
#### Post date: [June 11, 2019, 4:24pm UTC](https://community.thunkable.com/t/firebase-testing-for-a-null-response-for-a-key-search-help-please/101771/3 "2019-06-11T16:24:16Z")

</div>

Hi SOLVED

null is in fact a text representation for visual display and hence comparison with text of “null” is not valid.

So testing with logic null using a variable worked

see blocks

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/7/f70247e404134f7391809791b29d5ed75f7dd91f.png)

---

<div class="post-metadata">

### Author: ![Pete\_Marsh](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@Pete\_Marsh](https://community.thunkable.com/u/Pete_Marsh)
#### Post date: [June 11, 2019, 4:37pm UTC](https://community.thunkable.com/t/firebase-testing-for-a-null-response-for-a-key-search-help-please/101771/4 "2019-06-11T16:37:35Z")

</div>

p.s. Also removed variable and tested Value block direct works also

Pete

---

<div class="post-metadata">

### Author: ![Pete\_Marsh](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@Pete\_Marsh](https://community.thunkable.com/u/Pete_Marsh)
#### Post date: [June 12, 2019, 4:15pm UTC](https://community.thunkable.com/t/firebase-testing-for-a-null-response-for-a-key-search-help-please/101771/5 "2019-06-12T16:15:17Z")

</div>

Hi did not work as a string comparison  
Pete

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 12:13pm UTC](https://community.thunkable.com/t/firebase-testing-for-a-null-response-for-a-key-search-help-please/101771/6 "2024-11-08T12:13:32Z")

</div>


