Compare qr codes and don't scan again

I’m having trouble doing something simple, I have a qr code reader that it stores information in my database, how can I not keep the same qr code twice?

I did my logic, tried in many ways but I didn’t get results.

Use list to store data using tinydb
Then use IsInList block to find whether the code code is already present in a list or not

use else block to continue your work after then block

you are getting nothing from your if statement beside a notifcation, and when you check for a value that is already stored use return block to end the if statement or else to do what ever you want.

you are altering the scan result before storing to tinydb, and then you are comparing the fresh scan result with the one stored in tinydb which you modefied before storing.

I didn’t quite understand, I’m not saving in the tinydb list number 2, and comparing it with result number 1?

You are executing the block outside the else …
If idscaneados = Result true and false You are having it recorded being the same or being different. The save block can only be executed if it is different! = <>

1 Like

Could you explain why you created two topics with the same question ?