Help with inventory counter using scanner

Hello, I’m trying to make an app that uses a barcode scanner to count how many times that item has been scanned. Right now i have: QR code/ Barcode scanner tool (we’ll call scanner) > creates new item and saves the scanner result under a property called “code”. I have another page that has a scanner ,that links to a new page, with a list. The list is filtered to scanner result = code. Theres a countdown timer that updates the quantity of that item +1. Phew. So far it looks like this will do exactly what i want it to. The problem is, the users will have to enter all the items initially, themselves, because the items are the logged in users. I want the items themselves to be shared, but not the quantity. The idea is that when someone sells something in person, they scan it, and the app counts how many times that item has been scanned by that person. I’m ripping my hair out, thanks!

Hi @Zac217,

One of the possible solutions could be:

  • Have 3 collections: Users, Items and Transactions. Items should have the “UniqueID” property which (a) should be unique and (b) is efficiently a QR code. Items may have a relationship to Users (one User have multiple Items) to define who’s the owner.
    Transactions should have relationships to User and Item (so that one Transaction belongs uniquely to one User and to one Item).
  • When an item is scanned by a first user, on the next screen you identify if an Item with such UniqueID exists in the database (use a combination of a list + group with visibility conditions using Count).
    – If Item doesn’t exist, then create a new Item with the code and (optionally) set a relationship to Logged-In User to identify the owner.
    – If Item already exists (in this case you’ll have the list of Items filtered by QR code, and resulting list will contain just 1 item), you can create a new Transaction record with the Item and User.
    – optionally you can add another “Holder” relationship Item - User to see who is currently holding the item and also set it at the same time.

I’m not sure what your goals are and what your business process is. Maybe the setup described above could be useful.

Best,
Victor.

Thank you for the reply! I’m trying to replicate this now, just having a hard time understand it. To clarify, the app is for a small business that has sales people sell their product. The app wont actually be counting inventory, rather it will be tallying how many of each item a certain sales person sold. For example, if “Brad” sells 5 red shirts, the app will display “5x red shirts”. Would i make the quantity under the transactions collection? i cant make it under the item collection, or the field would be updated for everyone’s app. I’m trying to put it under transactions, but I cant figure out how to find the item the barcode matches, and update the transaction at the same time.

Hi @Zac217,

Ok, thanks for clarifying the requirements. Then my initial solution needs to be modified - I understood it was required to have a unique ID for each item and be able to track it.

Let’s assume a QR code / barcode is unique to an item type (e.g. all red shirts M size will have the same barcode, blue shirts L size - another barcode, etc). Also let’s assume that upon selling a salesperson takes the item, scans the barcode/QR code, and we need to count how many items of this type this exact person sold.

I would suggest the following solution (of course there could be other approaches):

  • Have the same Items collection, with unique codes. However, probably there is no need to make it “autofill”: usually an admin employee needs to add all the items available to this collection. Otherwise each salesperson can add any item, which is not good.
  • When a salesperson scans the code on a scanner screen: you record this code to some property (e.g. Logged-In-User → ScannedCode) and link a user to another screen. There you have a list of Items filtered by the code is equal to Logged-In-User → ScannedCode. As a result, you’ll have a single item from Items collection, which matches the code.
  • And then inside the list you have “Sell” button, which creates a Transaction with User=Logged-in User and Item= Current Item.

As a result you’ll have a list of all Transactions for all Users. You can create a list of Transactions for Logged-in User to see all their sales. You can create a list of Transactions filtered by Item and by User to see all transactions for a particular Item. And also you can count Transactions (filtered by User and Item) to see how many items were sold.

Just in case, here is the video about QR code scanner: https://youtu.be/Dfofeh7kh1c. The approach is a bit different there, but it can be useful to understand the general logic.

Best,
Victor.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.