My code is not working, I’m pretty new at Thunkable, it is suppose to return the answer but it returns as NaN. It has something to do with the item block(for item(item) in list) because everytime I insert the item variable, it reports NaN. What is wrong with me code? Thanks in advance.
I have a list of costs in the list variable total cost and im trying to get each value of the list with for each item item in list, but item doesn’t work.
When you use a
for each item in list block, it returns a list item, not an integer. You’re then trying to use the
item value as a list item #. That won’t work. Instead, replace the
in list [ ] get # block with the
I don’t think I understand what you mean. Could you show me through a picture somehow? I am a visual learner and relatively new to thunkable. Sorry for the inconvenience. But thanks for your help.
Remove this whole block:
And in its place, put the orange
So that line of code/blocks should read:
set app variable Subtotal to app variable Subtotal + item
If that doesn’t help, let me know and I can make a quick mock up or video.
It just takes a little while for me to make all of those variables and blocks in a new project… if you want to share your project link with me, I can make a video of what I mentioned.
It works! Thank you so much! I was stuck on this for hours until I found this forum.