# Returns null when loading the login

**URL:** <https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224>\
**Category:** Questions about Thunkable X\
**Created:** [May 24, 2022, 12:58pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224 "2022-05-24T12:58:04Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![yamiletcurbeloaceved](https://avatars.discourse-cdn.com/v4/letter/y/ebca7d/32.png) [@yamiletcurbeloaceved](https://community.thunkable.com/u/yamiletcurbeloaceved)\
**Post date:** [May 24, 2022, 12:58pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/1 "2022-05-24T12:58:04Z")

</div>

Hello I have a login screen with firebase and when it loads it returns null and I can’t figure out where the error is if someone can help me I appreciate it.

Thank you.

---

<div class="post-metadata">

**Author:** ![sketch](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sketch/32/109058_2.png) [@sketch](https://community.thunkable.com/u/sketch)\
**Post date:** [May 24, 2022, 1:42pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/2 "2022-05-24T13:42:52Z")

</div>

Could you show your blocks and What you’ve tried,  
This Will help us find the issue.

---

<div class="post-metadata">

**Author:** ![yamiletcurbeloaceved](https://avatars.discourse-cdn.com/v4/letter/y/ebca7d/32.png) [@yamiletcurbeloaceved](https://community.thunkable.com/u/yamiletcurbeloaceved)\
**Post date:** [May 24, 2022, 1:53pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/3 "2022-05-24T13:53:19Z")

</div>

here are the blocks

 ![Sin título 1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/b/2b5c348bc8480cb6066779612d8d4fc1f783e1f9.png)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 24, 2022, 1:59pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/4 "2022-05-24T13:59:16Z")

</div>

These blocks has nothing to do with Firebase.

You need first make sure you supplied the Firebase API key and the Database URL in the project settings page and then use the `Sign In` block to login / Sign Up using Firebase.

---

<div class="post-metadata">

**Author:** ![yamiletcurbeloaceved](https://avatars.discourse-cdn.com/v4/letter/y/ebca7d/32.png) [@yamiletcurbeloaceved](https://community.thunkable.com/u/yamiletcurbeloaceved)\
**Post date:** [May 24, 2022, 2:30pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/5 "2022-05-24T14:30:54Z")

</div>

I already checked it is well configured  
this is the login block

 ![Sin título 1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/7/b73727cc545f121f56b57e0ba430e770a19e47f4.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 24, 2022, 2:56pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/6 "2022-05-24T14:56:26Z")

</div>

Check if your Firebase rules allow read/write access.

Also do a simple test to see if you can assign a label’s text to cloud variable users/userid after logging in. Do you see a value there?

---

<div class="post-metadata">

**Author:** ![yamiletcurbeloaceved](https://avatars.discourse-cdn.com/v4/letter/y/ebca7d/32.png) [@yamiletcurbeloaceved](https://community.thunkable.com/u/yamiletcurbeloaceved)\
**Post date:** [May 24, 2022, 3:06pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/7 "2022-05-24T15:06:51Z")

</div>

If everything is correct

---

<div class="post-metadata">

**Author:** ![shrey](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shrey/32/105637_2.png) [@shrey](https://community.thunkable.com/u/shrey)\
**Post date:** [May 24, 2022, 3:43pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/8 "2022-05-24T15:43:27Z")

</div>

If the issue is with storing the email and then retrieving it when the user opens the app again, then this topic might solve your problem:

> [@Remember password](https://community.thunkable.com/t/remember-password/1191524/16):
>
> [image] You can use this to store whatever you want. (doesn’t have to be in a function) [image] And you can use this to auto fill in the password textbox

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [May 24, 2022, 3:49pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/9 "2022-05-24T15:49:08Z")

</div>

what error are you recieving?

---

<div class="post-metadata">

**Author:** ![yamiletcurbeloaceved](https://avatars.discourse-cdn.com/v4/letter/y/ebca7d/32.png) [@yamiletcurbeloaceved](https://community.thunkable.com/u/yamiletcurbeloaceved)\
**Post date:** [May 24, 2022, 3:49pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/10 "2022-05-24T15:49:34Z")

</div>

null

---

<div class="post-metadata">

**Author:** ![yamiletcurbeloaceved](https://avatars.discourse-cdn.com/v4/letter/y/ebca7d/32.png) [@yamiletcurbeloaceved](https://community.thunkable.com/u/yamiletcurbeloaceved)\
**Post date:** [May 24, 2022, 4:25pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/11 "2022-05-24T16:25:12Z")

</div>

It may be that the error is in firebase but where

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 24, 2022, 4:42pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/12 "2022-05-24T16:42:48Z")

</div>

You’re not giving enough information to help you.

Have you tried what @tatiang suggested?  
What was the output?  
Can you share the code you used to try the suggestion?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 24, 2022, 5:38pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/13 "2022-05-24T17:38:13Z")

</div>

You can test your Firebase rules by following these instructions:

[https://firebase.google.com/docs/rules/simulator](https://firebase.google.com/docs/rules/simulator)

If your Firebase rules are wrong, you won’t be able to access Firebase data from Thunkable now matter what you try.

---

<div class="post-metadata">

**Author:** ![yamiletcurbeloaceved](https://avatars.discourse-cdn.com/v4/letter/y/ebca7d/32.png) [@yamiletcurbeloaceved](https://community.thunkable.com/u/yamiletcurbeloaceved)\
**Post date:** [May 24, 2022, 8:07pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/14 "2022-05-24T20:07:12Z")

</div>

I already checked the rules and everything is correct, authentication everything  
 ![Sin título 1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/5/d51b8b76a22bc8a067305318349b505a087ddcad.png)

the problem is in this block when I remove the email\_input text to value the null is removed but the email is not saved in the label

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 24, 2022, 8:11pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/15 "2022-05-24T20:11:43Z")

</div>

I will reiterate what I said earlier

> [@muneer](#):
>
> These blocks has nothing to do with Firebase.

This has nothing to do with Firebase. This is a `Local Storage` block that only saves information in the device and reads the information from device storage. This block does not read or store anything in **Firebase**.

You are getting **null** because there is nothing stored **locally** under the key you are specifying.

---

<div class="post-metadata">

**Author:** ![yamiletcurbeloaceved](https://avatars.discourse-cdn.com/v4/letter/y/ebca7d/32.png) [@yamiletcurbeloaceved](https://community.thunkable.com/u/yamiletcurbeloaceved)\
**Post date:** [May 24, 2022, 8:29pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/16 "2022-05-24T20:29:25Z")

</div>

How can I solve it

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 24, 2022, 8:37pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/17 "2022-05-24T20:37:29Z")

</div>

> [@yamiletcurbeloaceved](#):
>
> solve it

You need to save (store) something first under the **key**. Only then you can read the same key and retrieve the value stored under it and assign it to the variable or a label.

You cannot retrieve data from an empty key.

---

<div class="post-metadata">

**Author:** ![yamiletcurbeloaceved](https://avatars.discourse-cdn.com/v4/letter/y/ebca7d/32.png) [@yamiletcurbeloaceved](https://community.thunkable.com/u/yamiletcurbeloaceved)\
**Post date:** [May 24, 2022, 9:30pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/18 "2022-05-24T21:30:32Z")

</div>

Ok I know thank you very much

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [August 22, 2022, 9:30pm UTC](https://community.thunkable.com/t/returns-null-when-loading-the-login/1893224/19 "2022-08-22T21:30:39Z")

</div>

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