My task is very simple, but I can’t figure out how to implement it completely inside Thunkable…
I want to create an application that, when you click the “Scan barcode” button, will scan it and save it in a variable, then display the value of the variable on the screen.
After receiving the value in this variable, you need to search for matches in the table from Google tables. If matches are found, then display the message “Found” on the screen, and if no matches are found, then display the message “Not found”. Please help me figure out what I’m doing wrong? I’m attaching a screenshot.
Here’s the tricky part of how you set up your blocks:
The “where S-Code =” section is looking for a comparison of that value with another value, as I’m sure you know. But the value you’re giving it is the result of a test block which either returns “GOOD” or “NO GOOD”. The actual test is whether stored variable ScanCode
is true or not. That’s it. Since ScanCode is probably something like “M31496”, it’s not going to really be true or false.
What you need to do instead is to have the right side of that condition be just stored variable ScanCode
. Take the test block out of that and instead move it to the left side of the get first row object
block. Because you want to test if the data source value is equal to the stored variable value and return “GOOD” or “NO GOOD”. Are you sure you want to store that result in ScanCode?
1 Like
Many thanks for the answer and willingness to help figure it out!
Sorry, I’m not sure… Can I ask you to send me the exact same screenshot as I posted incorrectly, but already with the necessary corrections? You would help me a lot in this way! Thank you in advance!
Sure, send me a link to your project and I can modify those blocks and post a screenshot. When you generate a share link, it creates a copy of the project. None of the changes I make will affect your original project.
1 Like
After looking at your blocks again and re-reading your first post above, I realized that you’re wanting to just find out if the scanned value exists in the data source. There’s an easier way to do that:
Project Link: Thunkable