# Getting database to remember switch positions

**URL:** https://community.thunkable.com/t/getting-database-to-remember-switch-positions/808811
**Category:** Questions about Thunkable X
**Tags:** firebase, beginner, switch
**Created:** [September 11, 2020, 7:52am UTC](https://community.thunkable.com/t/getting-database-to-remember-switch-positions/808811 "2020-09-11T07:52:40Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![lucgrant8t4p5d](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@lucgrant8t4p5d](https://community.thunkable.com/u/lucgrant8t4p5d)
#### Post date: [September 11, 2020, 7:52am UTC](https://community.thunkable.com/t/getting-database-to-remember-switch-positions/808811/1 "2020-09-11T07:52:40Z")

</div>

Hi guys, I did some research which helped me make these blocks but it isn’t working

The app is a scavenger search app, I want the users to check off items using the switches. I would like the switches to 'remember’their position not only on navigating around the but also on closing and opening the app.

Does anyone have any experience with this? The database is connected as I received an update there recording a switch as “1”

Thank you

 ![swtiches](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/7/07e98389869729db7faa340641617b5652e1769c.jpeg)

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [September 11, 2020, 8:44am UTC](https://community.thunkable.com/t/getting-database-to-remember-switch-positions/808811/2 "2020-09-11T08:44:05Z")

</div>

To save data, use the cloud variable blocks. It’s much easier.

Why do you use extra blocks? You have a switch. Write its state to the database directly, and not through " 0 " and “1”.

---

<div class="post-metadata">

### Author: ![lucgrant8t4p5d](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@lucgrant8t4p5d](https://community.thunkable.com/u/lucgrant8t4p5d)
#### Post date: [September 14, 2020, 5:08pm UTC](https://community.thunkable.com/t/getting-database-to-remember-switch-positions/808811/3 "2020-09-14T17:08:22Z")

</div>

Hey Actech,  
Thanks for your great feedback. Yes I’ve removed the database for now and I am saving the switch positions to the local storage in a much more economical manner.  
My screen has multiple rows and is vertically scrollable - an issue I now have is that I cannot see the top rows in edit mode, they seem to be out of frame? I can see them when I live test the app and everything works perfectly but in Edit it seems like they are stuck off the top of the screen?  
Any help is hugely appreciated.  
Kind regards  
Lucas

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [September 14, 2020, 5:29pm UTC](https://community.thunkable.com/t/getting-database-to-remember-switch-positions/808811/4 "2020-09-14T17:29:27Z")

</div>

That’s another question. Please create separate topics for different questions.

There are pitfalls with scrolling. You need to check the alignment mode in all blocks. The text should be aligned at the top so that it starts from the beginning.

---

<div class="post-metadata">

### Author: ![lucgrant8t4p5d](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@lucgrant8t4p5d](https://community.thunkable.com/u/lucgrant8t4p5d)
#### Post date: [September 14, 2020, 5:41pm UTC](https://community.thunkable.com/t/getting-database-to-remember-switch-positions/808811/5 "2020-09-14T17:41:38Z")

</div>

Thank you.  
Apologies I’m new and learning the rules. I appreciate your help!

---

<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:23pm UTC](https://community.thunkable.com/t/getting-database-to-remember-switch-positions/808811/6 "2024-11-08T12:23:58Z")

</div>


