Against what variable are you comparing 15.9 and 16?
I did try it on my phone with live app I get the same error except for the barcode scanner error
The value of the carbohydrates_100g
That doesnât make sense. That means you are checking whether the word âvalueâ is smaller than 15.9! Can you please share your entire, updated code once more?
Where is your âget propertyâŚâ code?
@muneer told me to remove it, because it caused my app to crash
You havenât added that. Against what should you compare 15.9 and 16?
Try adding it again. What youâre doing is comparing 15.9 and the word value. That doesnât make sense at all. The computer also gets confused. Thatâs why you donât get your healthy/not healthy value.
This is what I get when I added the âget propertyâ block
Have you added a grey border to your screen? Because this doesnât look like the Live Test app on the phone.
Download this:
Yes, itâs expected that you get âvalueâ, because thatâs what your variable contains.
This is what it looks like on my phone:
The value goes from 1 to 11 but never says anything in the health/unhealthy boxes (which are red and green)
Yes, I told you to try to localise the crash problem. Not to remove it for good. Now you know for certain that what crashes your app is something to do with the get property block that you are using.
This step does not solve the issue or any other issue but it pin point the faulty coding block.
Happy Thunking!
Thank you for clarifying! I watched all the tutorial on how to use the get property blocks and how to parse it properly but I canât find the error in the get property block. Can you see a problem with the way this is set up?
This is my web api url: https://world.openfoodfacts.org/api/v0/product/04963406
I think you should share the link to your project because seeing individual screenshots doesnât really paint a full picture of how you have things set up.
Those blocks on their own should work. But itâs what you have above and below them that also matters. And make sure youâre testing this on your phone in the Thunkable Live app, not in a browser.
I would like to share my project privatelyâŚis there a way to do that?
You can send the link in a private message to any recipients you choose. I donât know that Iâll have time to help today but youâre welcome to send it to me.
Okay, thank you! I added a few people on it. It would be great if you guys could take a look at that!
One problem right off the bat is that your URL is wrong. You added a static barcode (04963406) to the URL and then youâre joining it with whatever the barcode scanner returns.
So if you scan a barcode that has the value 04963406, your URL is going to be https://world.openfoodfacts.org/api/v0/product/0496340604963406.json which is an invalid API call.
This could have been fixed easily by assigning a label to the Web APIâs URL â remember to check variable values at each step.