Problems with variable values

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:

Here is the code:

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:

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

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

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

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

Thanks friends. <3

1 Like

Please help me guys!

1 Like

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.


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.


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.


Ok. Sorry :sweat_smile: Can be a little impatient.

Thanks for noticing, didn’t realise that.

Got it. Thanks.

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.

P.S: And sorry for being impatient. :sweat_smile:

Thanks guys.

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.


I’m focusing on screen 4 and screen 6.

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?


Thanks but just figured it out.

1 Like

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