# Google sheets data source undefined

**URL:** https://community.thunkable.com/t/google-sheets-data-source-undefined/3006739
**Category:** Issues / Bugs
**Created:** [May 16, 2024, 8:49am UTC](https://community.thunkable.com/t/google-sheets-data-source-undefined/3006739 "2024-05-16T08:49:39Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![creatorsoftomorrow2a](https://avatars.discourse-cdn.com/v4/letter/c/96bed5/32.png) [@creatorsoftomorrow2a](https://community.thunkable.com/u/creatorsoftomorrow2a)
#### Post date: [May 16, 2024, 8:49am UTC](https://community.thunkable.com/t/google-sheets-data-source-undefined/3006739/1 "2024-05-16T08:49:39Z")

</div>

Hello, I’ve been encountering problems with the using data source blocks. I’m not sure why but when I try to set the data from the google sheet to the text of a label, the label displays undefined in the web preview. I tried to preview the data in the data tab and the data seems to displaying fine over there.  
Just incase I put some screenshots here

I tried retrieving some data from the google sheet

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

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/a/8aaf51488a3cd4c94a716bf1d9f27d033c18efdb.png)  
But in web preview, all the label seems to show is undefined, also for some reason the other buttons also display undefined. I’ve replaced the data source block with a normal Text block and all the texts display properly. Hopefully someone can tell me whats wrong.

---

<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: [May 16, 2024, 1:13pm UTC](https://community.thunkable.com/t/google-sheets-data-source-undefined/3006739/2 "2024-05-16T13:13:26Z")

</div>

Hello @creatorsoftomorrow2a Welcome to the community.  
Unfortunately, it is not possible to initialize a variable with data source blocks.  
You could initialize the variable with a create block and update the variable when the screen opens/starts  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/6/b6c75ff00bb5eb95cc6d774781deba43a5d71c66.png)

---

<div class="post-metadata">

### Author: ![creatorsoftomorrow2a](https://avatars.discourse-cdn.com/v4/letter/c/96bed5/32.png) [@creatorsoftomorrow2a](https://community.thunkable.com/u/creatorsoftomorrow2a)
#### Post date: [May 16, 2024, 3:12pm UTC](https://community.thunkable.com/t/google-sheets-data-source-undefined/3006739/3 "2024-05-16T15:12:46Z")

</div>

Thank you so much! The data seems to appearing with no problem now. Just wondering but is it normal that it takes a few seconds to retrieve the data? Because there seems to a delay during the set variable to get value from Quiz Data (a few seconds), before it runs the function below it.

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

---

<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: [May 16, 2024, 7:24pm UTC](https://community.thunkable.com/t/google-sheets-data-source-undefined/3006739/4 "2024-05-16T19:24:45Z")

</div>

Hello @creatorsoftomorrow2a  
Yes, it is normal to take some seconds to load the data.  
The actual time depends on the device and internet connection

---

<div class="post-metadata">

### Author: ![creatorsoftomorrow2a](https://avatars.discourse-cdn.com/v4/letter/c/96bed5/32.png) [@creatorsoftomorrow2a](https://community.thunkable.com/u/creatorsoftomorrow2a)
#### Post date: [May 17, 2024, 5:02am UTC](https://community.thunkable.com/t/google-sheets-data-source-undefined/3006739/5 "2024-05-17T05:02:09Z")

</div>

There isn’t any block to detect when the data is actually finish loading right?

---

<div class="post-metadata">

### Author: ![matt\_conroy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/matt_conroy/32/150843_2.png) [@matt\_conroy](https://community.thunkable.com/u/matt_conroy)
#### Post date: [May 17, 2024, 8:42pm UTC](https://community.thunkable.com/t/google-sheets-data-source-undefined/3006739/6 "2024-05-17T20:42:18Z")

</div>

Not specifically, but there would be ways to essentially debug the blocks so you could visually see when the data has finished loading.

> [@Debugging in Thunkable X (Video)](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471):
>
> I thought I’d share a process I use for debugging my projects. It involves creating a function that can be used over and over throughout the code blocks in order to help determine where things are going wrong, whether or not certain blocks are ever triggering, and what the values of several variables are. Here’s a screenshot of what I’ve set up: The real power comes from being able to quickly change the delay (and even set it to 0 seconds) or just remo…
