# How to create nutrition app with ocr scanner?

**URL:** <https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955>\
**Category:** Questions about Thunkable X\
**Created:** [February 21, 2021, 5:28pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955 "2021-02-21T17:28:00Z")\
**Posts on this page:** 20\
**Page:** 10

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [March 14, 2021, 4:51pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/182 "2021-03-14T16:51:24Z")

</div>

Against what variable are you comparing 15.9 and 16?

---

<div class="post-metadata">

**Author:** ![celebytes20212iy4](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@celebytes20212iy4](https://community.thunkable.com/u/celebytes20212iy4)\
**Post date:** [March 14, 2021, 4:51pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/183 "2021-03-14T16:51:31Z")

</div>

I did try it on my phone with live app I get the same error except for the barcode scanner error

---

<div class="post-metadata">

**Author:** ![celebytes20212iy4](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@celebytes20212iy4](https://community.thunkable.com/u/celebytes20212iy4)\
**Post date:** [March 14, 2021, 4:52pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/184 "2021-03-14T16:52:08Z")

</div>

The value of the carbohydrates\_100g

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [March 14, 2021, 4:53pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/185 "2021-03-14T16:53:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![celebytes20212iy4](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@celebytes20212iy4](https://community.thunkable.com/u/celebytes20212iy4)\
**Post date:** [March 14, 2021, 4:54pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/186 "2021-03-14T16:54:17Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/c/acd15f1686296b739fa3aaa04be7535c7a6edd48.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/1/c12ee4afcea7b4e707758c83e480b220d3a603c5.png)

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [March 14, 2021, 4:55pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/187 "2021-03-14T16:55:41Z")

</div>

Where is your ‘get property…’ code?

---

<div class="post-metadata">

**Author:** ![celebytes20212iy4](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@celebytes20212iy4](https://community.thunkable.com/u/celebytes20212iy4)\
**Post date:** [March 14, 2021, 4:56pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/188 "2021-03-14T16:56:31Z")

</div>

@muneer told me to remove it, because it caused my app to crash

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [March 14, 2021, 4:56pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/189 "2021-03-14T16:56:43Z")

</div>

You haven’t added that. Against what should you compare 15.9 and 16?

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [March 14, 2021, 4:58pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/190 "2021-03-14T16:58:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![celebytes20212iy4](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@celebytes20212iy4](https://community.thunkable.com/u/celebytes20212iy4)\
**Post date:** [March 14, 2021, 4:59pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/191 "2021-03-14T16:59:50Z")

</div>

This is what I get when I added the “get property” block  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/d/cd4dd93aac26327fe3dc829740bb527b953a53c5.png)

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [March 14, 2021, 5:00pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/192 "2021-03-14T17:00:43Z")

</div>

Have you added a grey border to your screen? Because this doesn’t look like the Live Test app on the phone.

Download this:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/1/e1afc93bd7c31a1621b6070a5afe1fddd3da8789.png)

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [March 14, 2021, 5:02pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/193 "2021-03-14T17:02:36Z")

</div>

Yes, it’s expected that you get ‘value’, because that’s what your variable contains.

---

<div class="post-metadata">

**Author:** ![celebytes20212iy4](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@celebytes20212iy4](https://community.thunkable.com/u/celebytes20212iy4)\
**Post date:** [March 14, 2021, 5:07pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/194 "2021-03-14T17:07:05Z")

</div>

This is what it looks like on my phone:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/1/f14cba3540f8b33436cb9246a7529421454c4ed2.jpeg)  
The value goes from 1 to 11 but never says anything in the health/unhealthy boxes (which are red and green)

---

<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:** [March 14, 2021, 5:14pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/195 "2021-03-14T17:14:51Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![celebytes20212iy4](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@celebytes20212iy4](https://community.thunkable.com/u/celebytes20212iy4)\
**Post date:** [March 14, 2021, 5:35pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/196 "2021-03-14T17:35:41Z")

</div>

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?

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/4/442f23adbdcc8d42b11820bfbea86df589e391de.png)

This is my web api url: [https://world.openfoodfacts.org/api/v0/product/04963406](https://world.openfoodfacts.org/api/v0/product/04963406)

---

<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:** [March 14, 2021, 6:27pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/197 "2021-03-14T18:27:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![celebytes20212iy4](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@celebytes20212iy4](https://community.thunkable.com/u/celebytes20212iy4)\
**Post date:** [March 14, 2021, 6:30pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/198 "2021-03-14T18:30:16Z")

</div>

I would like to share my project privately…is there a way to do that?

---

<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:** [March 14, 2021, 6:54pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/199 "2021-03-14T18:54:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![celebytes20212iy4](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@celebytes20212iy4](https://community.thunkable.com/u/celebytes20212iy4)\
**Post date:** [March 14, 2021, 7:18pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/200 "2021-03-14T19:18:34Z")

</div>

Okay, thank you! I added a few people on it. It would be great if you guys could take a look at that!

---

<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:** [March 14, 2021, 7:38pm UTC](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955/201 "2021-03-14T19:38:39Z")

</div>

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/](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**.

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

[Previous page](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955.md?page=9)

[Next page](https://community.thunkable.com/t/how-to-create-nutrition-app-with-ocr-scanner/1113955.md?page=11)
