# Problems with variable values

**URL:** <https://community.thunkable.com/t/problems-with-variable-values/1661842>\
**Category:** Questions about Thunkable X\
**Tags:** beginner, coding\
**Created:** [December 28, 2021, 1:52pm UTC](https://community.thunkable.com/t/problems-with-variable-values/1661842 "2021-12-28T13:52:22Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![ant\_1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ant_1/32/183393_2.png) [@ant\_1](https://community.thunkable.com/u/ant_1)\
**Post date:** [December 28, 2021, 1:52pm UTC](https://community.thunkable.com/t/problems-with-variable-values/1661842/1 "2021-12-28T13:52:22Z")

</div>

Hey guys!

I’ve had this problem where when I click on the specific item(flower in a plastic bottle) it will show an alert, and when confirmed, it is supposed to show 1 in the Qty column in the row of the flower in plastic bottle row and instead it shows true and it is supposed to show 5 in the Price total column(same row as the flower in plastic bottle row) but instead it shows 0. But then when I click on the + button(for the flower in plastic bottle, it suddenly shows the correct thing. The other items work fine.

Please help me out guys!

Here is an image of the screen:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/c/8c4f38634795a14fe6bab8622188caecc271d5ae.png)

Here is the code:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/5/55d92af67bb618c825d452e0f4f14083a95f10a9.jpeg)

Then, unfortunately, here comes another error.

So basically, when I get to the next screen, and I click the buy button, it will turn the app variables to null(cos i want all the app variables to be set to 0 so when the user wants to go on the shopping screen, it will reset everything.). But then, when I go back on the shopping screen, it shows the same values as before.

Then when I click on the + or the - button, it suddenly shows NaN in the price total. But when I click on the item, it shows the same thing as the other error above for the qty column but shows NaN in the Price column.

Here is an image:

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

Here is an image of the other screen(works pretty much fine):

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

Here is the code of the other screen(the screen that i showed you right above this image:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/e/4e6e1c05c175a20892f9c3943fec94b37174f7c0.jpeg)

So please help me out guys for both of these errors! And quickly please cause my homework is due NEXT WEEK 😓!

I may have not explained clearly so if you guys have any questions please go ahead and ask(but quickly please. 😅).

Thanks friends. \<3

---

<div class="post-metadata">

**Author:** ![ant\_1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ant_1/32/183393_2.png) [@ant\_1](https://community.thunkable.com/u/ant_1)\
**Post date:** [December 28, 2021, 2:35pm UTC](https://community.thunkable.com/t/problems-with-variable-values/1661842/2 "2021-12-28T14:35:59Z")

</div>

Please help me guys!

---

<div class="post-metadata">

**Author:** ![Dean\_Artis](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@Dean\_Artis](https://community.thunkable.com/u/Dean_Artis)\
**Post date:** [December 28, 2021, 3:12pm UTC](https://community.thunkable.com/t/problems-with-variable-values/1661842/3 "2021-12-28T15:12:59Z")

</div>

Please be patient. Don’t create a topic and then less than half an hour later spam by asking for help again. When someone knows the answer they will help.

---

<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:** [December 28, 2021, 3:29pm UTC](https://community.thunkable.com/t/problems-with-variable-values/1661842/4 "2021-12-28T15:29:07Z")

</div>

Can you share your project?

I can see a lot of mix and match in the variables. For example, when you click on `Flower` you are displaying the `currently signing up` variable. Is this correct?

Another example is mixing between flower variables and cactus variables. The same for Eco system variables.

Very hard to say what would go wrong in such situations.

---

<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 28, 2021, 8:51pm UTC](https://community.thunkable.com/t/problems-with-variable-values/1661842/5 "2021-12-28T20:51:26Z")

</div>

> [@ant\_1](#):
>
> And quickly please cause my homework is due NEXT WEEK 😓!

We’re not responsible for your homework getting done. You are. Please don’t ask people on the forums to hurry to respond to your questions. If someone has an answer, they will post it. If not, you either need to do the work yourself by Googling, watching videos, etc. or you need to be patient.

You’ve provided a lot of details which is good but you may want to include the project link as well so that people can see how you have the whole project set up.

---

<div class="post-metadata">

**Author:** ![ant\_1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ant_1/32/183393_2.png) [@ant\_1](https://community.thunkable.com/u/ant_1)\
**Post date:** [December 30, 2021, 10:41am UTC](https://community.thunkable.com/t/problems-with-variable-values/1661842/6 "2021-12-30T10:41:37Z")

</div>

Ok. Sorry 😅 Can be a little impatient.

---

<div class="post-metadata">

**Author:** ![ant\_1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ant_1/32/183393_2.png) [@ant\_1](https://community.thunkable.com/u/ant_1)\
**Post date:** [December 30, 2021, 10:42am UTC](https://community.thunkable.com/t/problems-with-variable-values/1661842/7 "2021-12-30T10:42:55Z")

</div>

> [@muneer](#):
>
> displaying the `currently signing up` variable.

Thanks for noticing, didn’t realise that.

---

<div class="post-metadata">

**Author:** ![ant\_1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ant_1/32/183393_2.png) [@ant\_1](https://community.thunkable.com/u/ant_1)\
**Post date:** [December 30, 2021, 10:43am UTC](https://community.thunkable.com/t/problems-with-variable-values/1661842/8 "2021-12-30T10:43:37Z")

</div>

Got it. Thanks.

---

<div class="post-metadata">

**Author:** ![ant\_1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ant_1/32/183393_2.png) [@ant\_1](https://community.thunkable.com/u/ant_1)\
**Post date:** [December 30, 2021, 3:09pm UTC](https://community.thunkable.com/t/problems-with-variable-values/1661842/9 "2021-12-30T15:09:28Z")

</div>

Hi again guys.  
I’ve had some issues here.

So this time, I had checked my coding and I was using the correct variables. But strangely, whenever I click the flower item, it works fine, but after clicking it, when I try clicking the cactus item, it suddenly doesn’t show the correct value for the nbTotal label and the PriceTotal label. But then when I click the + button, it suddenly shows the correct value. But when I click on the + button(when the value is 0 for the cactus) it shows the correct value that I want.

If you guys need the project link, here it is.

[https://x.thunkable.com/copy/7b1f9df3f665ab2e88eaab8fa0870afc](https://x.thunkable.com/copy/7b1f9df3f665ab2e88eaab8fa0870afc)

P.S: And sorry for being impatient. 😅

Thanks guys.

---

<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 30, 2021, 7:48pm UTC](https://community.thunkable.com/t/problems-with-variable-values/1661842/10 "2021-12-30T19:48:22Z")

</div>

It’s helpful to have a project link but when you have 17 screens and we don’t know your app at all, we’re lost trying to figure out what you mean.

Please be specific about which screen(s) you’re talking about.

---

<div class="post-metadata">

**Author:** ![ant\_1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ant_1/32/183393_2.png) [@ant\_1](https://community.thunkable.com/u/ant_1)\
**Post date:** [December 31, 2021, 5:58am UTC](https://community.thunkable.com/t/problems-with-variable-values/1661842/11 "2021-12-31T05:58:19Z")

</div>

I’m focusing on screen 4 and screen 6.

---

<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 31, 2021, 9:43pm UTC](https://community.thunkable.com/t/problems-with-variable-values/1661842/12 "2021-12-31T21:43:21Z")

</div>

I looked at those screens but I’m still not clear on the steps you’re taking. For example, I added a flower and two cactuses and it showed subtotals of 5 and 20 and a total of 25. That seems correct.

Can you provide a video of the steps you’re doing and the outcome?

---

<div class="post-metadata">

**Author:** ![ant\_1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ant_1/32/183393_2.png) [@ant\_1](https://community.thunkable.com/u/ant_1)\
**Post date:** [January 3, 2022, 3:33am UTC](https://community.thunkable.com/t/problems-with-variable-values/1661842/13 "2022-01-03T03:33:12Z")

</div>

Thanks but just figured it out.

---

<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:** [April 3, 2022, 3:34am UTC](https://community.thunkable.com/t/problems-with-variable-values/1661842/14 "2022-04-03T03:34:12Z")

</div>

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