# Debugging in Thunkable X (Video)

**URL:** <https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471>\
**Category:** Tutorials and DIY Guides\
**Tags:** community, tips, debug\
**Created:** [September 25, 2020, 6:25pm UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471 "2020-09-25T18:25:50Z")\
**Posts on this page:** 20\
**Page:** 1

<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:** [September 25, 2020, 6:25pm UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/1 "2020-09-25T18:25:50Z")

</div>

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:

 ![Screen Shot 2020-09-25 at 12.39.27 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/d/bd8c8908238052be9840249deb5a9c9a7bc46e35.png)

The real power comes from being able to quickly change the delay (and even set it to 0 seconds) or just remove the contents of the function so that it doesn’t run at all when you’re ready to publish. I cover all of that in the video.

If you want to try out the project yourself: [Thunkable](https://x.thunkable.com/copy/741e7ea3a9d1d03e19ea6ef33f0db9d9)

And a video that shows how to do this and explains why I do it this way:

[![](https://img.youtube.com/vi/HZURq5Lj3BY/hqdefault.jpg "Debugging in Thunkable") ](https://www.youtube.com/watch?v=HZURq5Lj3BY)

---

<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:** [September 26, 2020, 8:05am UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/2 "2020-09-26T08:05:57Z")

</div>

Thank you for sharing your thoughts. Very useful 👏🏻

---

<div class="post-metadata">

**Author:** ![dhanushan48608nkfw](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@dhanushan48608nkfw](https://community.thunkable.com/u/dhanushan48608nkfw)\
**Post date:** [September 14, 2022, 9:14am UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/3 "2022-09-14T09:14:02Z")

</div>

I found the issue, When I add the dvl or dvg and select the data source, it crashes, When I removed the data source it works. But i need that dvl. What to do?

---

<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:** [September 14, 2022, 11:15pm UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/4 "2022-09-14T23:15:14Z")

</div>

This is a topic related to debugging in general. It’s not really for specific questions about problems you’ve found in your code.

I recommend starting a new topic and including as many details (e.g. screenshots, link to your project) as possible.

---

<div class="post-metadata">

**Author:** ![dhanushan48608nkfw](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@dhanushan48608nkfw](https://community.thunkable.com/u/dhanushan48608nkfw)\
**Post date:** [September 18, 2022, 6:08am UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/5 "2022-09-18T06:08:50Z")

</div>

I’m sorry, I wasn’t aware of that. I’ll do it

---

<div class="post-metadata">

**Author:** ![andos-avlog](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/andos-avlog/32/122340_2.png) [@andos-avlog](https://community.thunkable.com/u/andos-avlog)\
**Post date:** [December 12, 2022, 3:36pm UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/6 "2022-12-12T15:36:16Z")

</div>

Hi @tatiang, using the video you sent to me, I created the **Debug blocks** (See below)

**Debug blocks**

 ![Debug_Variable_Block-Screenshot 2022-12-12 15.07.43](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/b/6b6cfc61ac8f12ca6bcf6d59b71dbbb2531976dd.png)

 ![Debug Blocks-Screenshot 2022-12-12 15.06.50](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/9/990af89c9a4d34a460111ffe84135816c2449be0.png)

I then tried to get them to work to find my issues by adding a **User\_Values\_Label** to the **Debug blocks**. The plan was to find if my **Login Page** was searching for my **Username** during the **Login** process.

See video for what happened:

[![](https://img.youtube.com/vi/ZEI4W-9GP5g/hqdefault.jpg "AvLog Group Thunkable Debug Video") ](https://www.youtube.com/watch?v=ZEI4W-9GP5g)

Andos

---

<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:** [December 12, 2022, 5:08pm UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/7 "2022-12-12T17:08:37Z")

</div>

Okay so it runs through the loop and completes the set of blocks in `when Debug Click` and successfully displays 1, 2, 3, 4, 5, end. Did that answer your question?

---

<div class="post-metadata">

**Author:** ![andos-avlog](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/andos-avlog/32/122340_2.png) [@andos-avlog](https://community.thunkable.com/u/andos-avlog)\
**Post date:** [December 12, 2022, 5:50pm UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/8 "2022-12-12T17:50:12Z")

</div>

Hi @tatiang, I’m afraid it doesn’t answer my question because as my **Login Screen** loads, it stops at the loading icon. This suggests to me that it, either, for some reason has stopped finding the Firebase Sheet with Member details or it somehow has stopped verifying the sheet details. In which case, how can this **Debug** operation run through my Firebase sheet and not find anything wrong? Or, is the **Debug** operation not checking the **Firebase Members** sheet? I really don’t understand what it is that I am doing.

Are my blocks correctly set up to check my Firebase sheet? If not, how do I do this?

Please see my blocks below:

 ![Login Screen blocks-Screenshot 2022-12-12 17.42.02](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/6/a6683f33105204c3d631960e6b9bca0c390fee86.png)

Andos.

---

<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:** [December 12, 2022, 7:05pm UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/9 "2022-12-12T19:05:58Z")

</div>

The `when Debug Click` set of blocks doesn’t have anything to do with your Firebase data, as far as I can tell.

Now that you have a `Run_Debug` function, add it to the `SignIn` block because that’s where you want to see what’s happening. So inside of `SignIn`, add the function a few times to see where it works (displays the message) and where it doesn’t.

**Edit:** actually, now that I look more closely, you’re not using **any** Firebase blocks except the SignIn. So I’m not sure how much good that type of debugging is going to do. But I’d still try it!

More importantly, you need to debug the `getUser` function as I think I mentioned earlier. That’s where I’d focus my time. Check that the list of values blocks are returning the values you expect them to. Don’t rely on those blocks without double-checking.

---

<div class="post-metadata">

**Author:** ![andos-avlog](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/andos-avlog/32/122340_2.png) [@andos-avlog](https://community.thunkable.com/u/andos-avlog)\
**Post date:** [December 13, 2022, 1:40pm UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/10 "2022-12-13T13:40:21Z")

</div>

Hi @tatiang, I apologise for sounding stupid but, how do I fit the **Run\_Debug** function into the **getUser** block so it works.

Have I inserted the **Run\_Debug** function correctly? See below:

 ![GetUserDebugblocksScreenshot 2022-12-13 13.30.36](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/5/85a86f8300e31b7ae87ee6fbf5328b7436f87e48.png)

I am still only receiving the result in the video below:

[![](https://img.youtube.com/vi/ZEI4W-9GP5g/hqdefault.jpg "AvLog Group Thunkable Debug Video") ](https://www.youtube.com/watch?v=ZEI4W-9GP5g)

Andos

---

<div class="post-metadata">

**Author:** ![andos-avlog](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/andos-avlog/32/122340_2.png) [@andos-avlog](https://community.thunkable.com/u/andos-avlog)\
**Post date:** [December 13, 2022, 2:18pm UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/11 "2022-12-13T14:18:08Z")

</div>

Hi @tatiang, I have a few questions…

1. If the **Run\_Debug** function counts 1 thru 5, does that mean there are no errors?

2. What should I be seeing?

3. My members’ list is not being displayed in the countdown. Is there a way to make this happen?

4. With no **Members’ List** contents being shown, does that imply that the **Members’ List**  
is not being read?

5. 

> [@tatiang](#):
>
> So inside of `SignIn`, add the function a few times to see where it works (displays the message) and where it doesn’t.

I am guessing by “ **messages** ” you mean the “ **Starting** ”, “ **Running** ”, “ **Complete** ” and “ **End** ” messages, or should I receive some sort of other message?

1. What are the numbers 1 thru 5 actually counting and what is their purpose? Are they counting rows in the “ **Firebase** ” spreadsheet?

Once again, I apologise for what may seem to be “stupid” questions but I somehow am not qrasping what the **Run\_Debug** function is trying to do exactly.

Andos.

Andos.

---

<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:** [December 13, 2022, 2:56pm UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/12 "2022-12-13T14:56:19Z")

</div>

I think you misunderstood the purpose of the debugging function. It doesn’t tell you anything by itself. All it does is display a value and then wait so you can read that value on the screen.

It’s no different than using these blocks:  
Set label’s text to “1”  
Wait 1 second

But I got tired of adding and configuring those blocks over and over again so I made a function to save me time.

So why use them? Well, what I usually do is to space the debug function throughout any blocks that don’t seem to be working. Like this

When [event]  
Debug “1”  
[Some blocks]  
Debug “2”  
[some blocks]  
Debug “3”

That way, when I preview my project, if I only see “1”… “2” then I know the code stopped working between where I have debug “2” and where I have debug “3”. Then I can add more debugging functions between those to further narrow down what is causing the problem.

But it’s possible that all of the blocks run and I see “1”… “2”… “3”. Then what? Well, in your case you might set the debug function to display the value of each of your variables in the getUser function. That way you can see if their values are what you expect them to be. Or you might display the number of rows in your data source. Maybe you think it’s 25 but it’s really 600 or 10. That happened to me recently.

So the debug function can help to show you values while your project is running rather than only at the end. It helps to slow things down so you can figure out where something went wrong.

**If it still doesn’t make sense, share a new project link and I can provide a screenshot of your blocks with debugging blocks added.**

---

<div class="post-metadata">

**Author:** ![andos-avlog](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/andos-avlog/32/122340_2.png) [@andos-avlog](https://community.thunkable.com/u/andos-avlog)\
**Post date:** [December 13, 2022, 4:02pm UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/13 "2022-12-13T16:02:01Z")

</div>

Hi @tatiang, I sort of understand a little better but I still don’t really know where I should put these blocks or how they would fit. Below, I have attached a project link, as requested, for you to look at.

[https://x.thunkable.com/copy/30abe8cafdbf40b76b5f4a6403210b90](https://x.thunkable.com/copy/30abe8cafdbf40b76b5f4a6403210b90)

Andos.

---

<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:** [December 13, 2022, 7:12pm UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/15 "2022-12-13T19:12:39Z")

</div>

Here’s how I would set up the blocks. The basic idea is that each time you set a variable value, you then display that variable. And I would probably increase the wait time in the Run\_Debug function to 1 or 2 seconds so you have enough time to see the values that appear.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/5/5507e250d3b50a77b3834dc2e623cd9aa36e4e2c.png)

---

<div class="post-metadata">

**Author:** ![andos-avlog](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/andos-avlog/32/122340_2.png) [@andos-avlog](https://community.thunkable.com/u/andos-avlog)\
**Post date:** [December 14, 2022, 1:03pm UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/16 "2022-12-14T13:03:24Z")

</div>

Hi @tatiang, I shall try this and let you know how I get on.

Andos.

---

<div class="post-metadata">

**Author:** ![andos-avlog](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/andos-avlog/32/122340_2.png) [@andos-avlog](https://community.thunkable.com/u/andos-avlog)\
**Post date:** [December 14, 2022, 1:38pm UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/17 "2022-12-14T13:38:32Z")

</div>

Hi @tatiang, I set up the blocks as you suggested. (see below).

**Blocks for debugging get\_user function** :

 ![GetUserDebugBloclks-Screenshot 2022-12-14 13.19.17](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/b/eb73b808775e33a26d1f6d990ca1191a37a7936d.png)

The Live Test result link is shown below:

[![](https://img.youtube.com/vi/oTxkcZ3J3zo/hqdefault.jpg "AvLog Group Video") ](https://www.youtube.com/watch?v=oTxkcZ3J3zo)

Does this mean there are no errors in my " **getUser** function?

Or, have done something wrong?

Andos.

---

<div class="post-metadata">

**Author:** ![andos-avlog](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/andos-avlog/32/122340_2.png) [@andos-avlog](https://community.thunkable.com/u/andos-avlog)\
**Post date:** [December 14, 2022, 2:03pm UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/18 "2022-12-14T14:03:52Z")

</div>

Hi @tatiang, I’ve just spotted and error I made please ignore previous **results image and video**. The amended image and video are below:

**Blocks image**

 ![Amended GetUserDebugblocks-Screenshot 2022-12-14 13.44.05](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/b/cb5610222bf39595bd00a02445ac67a6210dc4bc.png)

**Live Test result video**

[![](https://img.youtube.com/vi/kaTXrEjlFbA/hqdefault.jpg "AvLog Group Video") ](https://www.youtube.com/watch?v=kaTXrEjlFbA)

Andos.

---

<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:** [December 14, 2022, 3:42pm UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/19 "2022-12-14T15:42:57Z")

</div>

I don’t understand the video. It’s looping through numbers 1-5 which I suggested is not that helpful. Where are the debugging values inside of the getUser function (“index”, “username”, etc.)?

---

<div class="post-metadata">

**Author:** ![andos-avlog](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/andos-avlog/32/122340_2.png) [@andos-avlog](https://community.thunkable.com/u/andos-avlog)\
**Post date:** [December 15, 2022, 10:22am UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/20 "2022-12-15T10:22:14Z")

</div>

Hi @tatiang, I have placed the **Run\_Debug** blocks within the **getUser** as you suggested (see blocks)

 ![getUser Debug blocks-Screenshot 2022-12-15 10.14.08](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/0/b0fe8e9e3ca95c0b8cb0ecca253e15582b834456.png)

but it just counts thru with numbers.

Has this anything to do with my **Debug Click** blocks below?

 ![Debug Click blocks-Screenshot 2022-12-15 10.18.36](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/9/99684f82156656b1fc06a511674e467ceffeb824.png)

I can’t help thinking that the **Debug** function isn’t picking up/ reading anything.

Andos.

---

<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:** [December 16, 2022, 1:17am UTC](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471/21 "2022-12-16T01:17:05Z")

</div>

Clicking the Debug button is just going to show 1, 2, 3, 4, 5 again.

For the debugging to work properly, you have to call the **getUser** function. That happens here:

 ![Screen Shot 2022-12-15 at 5.15.54 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/9/095a8484a54bc47e82437ecfdf3ac2bde551549b.png)

[Next page](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471.md?page=2)
