# \[Solved\] How do I use Google Sheets on a device?

**URL:** <https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924>\
**Category:** Questions about Thunkable X\
**Tags:** solved, spreadsheets\
**Created:** [May 10, 2021, 12:01pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924 "2021-05-10T12:01:24Z")\
**Posts on this page:** 20\
**Page:** 1

<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 10, 2021, 12:01pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/1 "2021-05-10T12:01:24Z")

</div>

Hello everyone!  
Hope evryone is doing wel.  
I have a bit of a problem.  
I’ve created a random qoute system that uses google sheet to get the qoutes  
and then displays a random qoute in the button.  
It works as supposed on the web-preview but when I download it it doesn’t work on my chromebook or android phone.  
here are my blocks:

 ![Screenshot 2021-05-10 1.56.57 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/4/c436906e579d5ac3579802ebbe4f7091020ae980.png)  
how do i fix this?  
Thanks

---

<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:** [May 10, 2021, 12:22pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/2 "2021-05-10T12:22:22Z")

</div>

Hi @sketch

Can you try download and test one of these #wdc quote apps that are powered by Google Sheets:

> [@art WDC #8 Can you re-create Victoria's Quote Gallery using Google Sheets?](https://community.thunkable.com/t/wdc-8-can-you-re-create-victorias-quote-gallery-using-google-sheets/1189068):
>
> Thanks again to everyone who participated in the [weekend design challenge](https://community.thunkable.com/t/wdc-7-can-you-re-create-toms-candle-or-kitkat-app/1174984) last week. I went back to Twitter again this week for inspiration and found a [fantastic tutorial](https://twitter.com/lo_victoria2666/status/1375091644337324035?s=20) by Victoria Lo about how to build a Quote Gallery using Google Sheets. You can try out the app for yourself [here](https://quote-gallery.vercel.app/): [https://quote-gallery.vercel.app/](https://quote-gallery.vercel.app/) It’s a great step-by-step guide to using React to connect to Google Sheets and display some inspirational or motivational quotes in your app. Sinc…

Also, I’ve never tried the `device is online` block on a Chrombook so that’s another thing that would be worth looking into!

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [May 10, 2021, 12:23pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/3 "2021-05-10T12:23:10Z")

</div>

Can you explain what you mean by “doesn’t work”?

If you’re getting a white screen or crash message, I suspect that you need to see if the stored variable is NULL before you try to get its length. That’s probably crashing your app.

---

<div class="post-metadata">

**Author:** ![backscratcher2007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/backscratcher2007/32/104623_2.png) [@backscratcher2007](https://community.thunkable.com/u/backscratcher2007)\
**Post date:** [May 10, 2021, 12:24pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/4 "2021-05-10T12:24:23Z")

</div>

hi  
I think i may have found the problem, you can’t do length of a variable that is not a list, so you might want to set it to an empty list and then while setting it to something, i would add to list, instead of setting the variable to the value.

---

<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 10, 2021, 12:34pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/5 "2021-05-10T12:34:10Z")

</div>

It works in the web preview because while you are developing and testing you have updated the `stored variable` and it reported something other than **null**.

When you moved to your mobile or Chromebook, There is no `stored variable` saved for your app and therefore the app failed.

Just as @catsarisky advised, manage your use of `stored variable` by testing for **null** prior to assigning it anything or using it for anything and your app should work as expected.

---

<div class="post-metadata">

**Author:** ![backscratcher2007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/backscratcher2007/32/104623_2.png) [@backscratcher2007](https://community.thunkable.com/u/backscratcher2007)\
**Post date:** [May 10, 2021, 12:38pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/6 "2021-05-10T12:38:58Z")

</div>

@sketch  
I took the liberty of checking out your project by your username and I edited it. It seems to work now.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/3/2384d740e4f7147b38086fa6fdc3ca3e5775620b.png) The link is [here](https://x.thunkable.com/copy/d5050b61995ae28b4c24059893ef1dfc)  
PS - i duplicated your project and all i got from the data is thunkable so thats it that is in the quotes

---

<div class="post-metadata">

**Author:** ![goutham](https://avatars.discourse-cdn.com/v4/letter/g/22d042/32.png) [@goutham](https://community.thunkable.com/u/goutham)\
**Post date:** [May 10, 2021, 12:50pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/7 "2021-05-10T12:50:58Z")

</div>

👊 🙂

---

<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 10, 2021, 1:08pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/8 "2021-05-10T13:08:04Z")

</div>

thank you so much that works.  
Still one qeustion is there a way to remove the Delay before IT picks a random qoute?

> [@domhnallohanlon](#):
>
> I’ve never tried the `device is online` block on a Chrombook so that’s another thing that would be worth looking into!

It seems to work for me.

---

<div class="post-metadata">

**Author:** ![backscratcher2007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/backscratcher2007/32/104623_2.png) [@backscratcher2007](https://community.thunkable.com/u/backscratcher2007)\
**Post date:** [May 10, 2021, 1:19pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/9 "2021-05-10T13:19:00Z")

</div>

I didn’t quite understand what you meant, but you could always remove the wait 5? And i to have a question for you, is there a specific reason why you do function quote twice?

---

<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 10, 2021, 1:26pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/10 "2021-05-10T13:26:30Z")

</div>

> [@backscratcher2007](#):
>
> And i to have a question for you, is there a specific reason why you do function quote twice?

Just so you don’t have to see the qoute for 10 seconds.

> [@backscratcher2007](#):
>
> didn’t quite understand what you meant

I have a button that displays the qoute.  
But When i open the app IT waits 2 seconds before change to nothing.  
And Then another second before picking a random qoute.  
Sonetimes IT Just hangs at a empty button.

---

<div class="post-metadata">

**Author:** ![backscratcher2007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/backscratcher2007/32/104623_2.png) [@backscratcher2007](https://community.thunkable.com/u/backscratcher2007)\
**Post date:** [May 10, 2021, 1:32pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/11 "2021-05-10T13:32:08Z")

</div>

When I live tested it, it comes almost immediately, and one last question, do you want the user to wait 10 seconds or can you just speed up that process by removing one of the wait 5.

---

<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 10, 2021, 1:36pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/12 "2021-05-10T13:36:37Z")

</div>

> [@backscratcher2007](#):
>
> When I live tested it, it comes almost immediately

that doesn’t seem to be my case.

> [@backscratcher2007](#):
>
> do you want the user to wait 10 seconds or can you just speed up that process by removing one of the wait 5

I can speed it a bit up.

---

<div class="post-metadata">

**Author:** ![backscratcher2007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/backscratcher2007/32/104623_2.png) [@backscratcher2007](https://community.thunkable.com/u/backscratcher2007)\
**Post date:** [May 10, 2021, 1:41pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/13 "2021-05-10T13:41:38Z")

</div>

To prove my point, I opened network in web development tools, all the packets that are being requested are coming in a matter of milliseconds, only your logo took about 246 ms, that is

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/3/a3110af7c4496c0d2490bc8d7c83eee0603be48d.png)  
still less than a second, also some other packets are taking 0ms  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/1/315e405d9f93a2fbd3477c126d116651f8262d02.png)

---

<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 10, 2021, 1:51pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/14 "2021-05-10T13:51:35Z")

</div>

hmm i did the same check it says that it took 1.7 minutes to load.

---

<div class="post-metadata">

**Author:** ![backscratcher2007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/backscratcher2007/32/104623_2.png) [@backscratcher2007](https://community.thunkable.com/u/backscratcher2007)\
**Post date:** [May 10, 2021, 1:51pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/15 "2021-05-10T13:51:59Z")

</div>

I was just looking at your code and wondering, do you have to set a stored variable to the quotes or can you just call directly from google sheets? Unless you have planned for offline use.

---

<div class="post-metadata">

**Author:** ![backscratcher2007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/backscratcher2007/32/104623_2.png) [@backscratcher2007](https://community.thunkable.com/u/backscratcher2007)\
**Post date:** [May 10, 2021, 1:52pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/16 "2021-05-10T13:52:19Z")

</div>

minutes or microseconds?

---

<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 10, 2021, 1:53pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/17 "2021-05-10T13:53:16Z")

</div>

> [@backscratcher2007](#):
>
> minutes or microseconds?

minutes.

> [@backscratcher2007](#):
>
> Unless you have planned for offline use.

I do plan to do that.

---

<div class="post-metadata">

**Author:** ![backscratcher2007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/backscratcher2007/32/104623_2.png) [@backscratcher2007](https://community.thunkable.com/u/backscratcher2007)\
**Post date:** [May 10, 2021, 1:55pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/18 "2021-05-10T13:55:44Z")

</div>

then, unless you are constantly updating, you could set your quotes in that variable, as i had set it to empty list in the top most part of the code. And if you actually want random quotes i would suggest web api. And unless you are planning to do something with the button, i would use a label if i were 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 10, 2021, 2:32pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/19 "2021-05-10T14:32:57Z")

</div>

Yeah.  
But i wil leave IT like this.  
Also the Delay is gone now.  
I gues IT was Just a wifi problem.  
Thanks for helping!

---

<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 10, 2021, 2:46pm UTC](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924/20 "2021-05-10T14:46:09Z")

</div>

> [@backscratcher2007](#):
>
> i would use a label if i were you.

The label is broken for me so i use this workaround.  
IT doesn’t change position or size like the button does.

[Next page](https://community.thunkable.com/t/solved-how-do-i-use-google-sheets-on-a-device/1273924.md?page=2)
