Newbie: How to keep a tally of the highest number for a counter and then increment +1

**Short Question: What is the recommended approach for this scenario please:- **
How do we check a barcode is new for a specified Collection [ Client / Batch ] , if new [true] then find the highest Box number ( 1, 2, 3, 4 etc ) already allocated in that Collection in Google Sheets and then automatically increment Box number by 1 to associate with this new box barcode ?

Summary: Want to scan barcodes on multiple boxes that are part of a common collection (such as Client name) in one go without having to manually select identical data for each box one by one . e.g How do I track whats the highest “Box number” allocated within a Collection to a barcode on a box stored in Google Sheets that is already associated to a specific Client and batch name, and then increment automatically by 1 when I scan another box that is part of the same client and batch but the barcode and box doesn’t yet exist in the system so its assumed to be new and needs to be allocated the next available box number automatically? I’m using Google Sheets to store the data. This avoids Boxes being allocated duplicate Box numbers by a user and avoids repeatedly having to enter Client and Batch number for each and every box.

Examples:

  • Scan barcode : Result: It doesn’t exist in Google Sheets so assume new box
  • Collection: Client= Vodafone, Box Batch = 2,
  • Box 1
  • associated with barcode ABCD000001
  • Scan barcode : Result: It doesn’t exist in Google Sheets so assume new box
  • Collection: Client= Vodafone, Box Batch = 2
  • Box 2
  • associated with barcode ABCD002301
  • Scan barcode : Result: It doesn’t exist in Google Sheets so assume new box
  • Collection: Client= Vodafone, Box Batch = 3
  • Box 1
  • associated with barcode ABCD305301
  • Scan barcode : Result: It doesn’t exist in Google Sheets so assume new box
  • Collection: Client= Vodafone, Box Batch = 3
  • Box 2
  • associated with barcode ABCD0000201
  • Scan barcode : Result: already exists in Google Sheets so already added to the system
  • Now Show existing details : Collection: Client= Vodafone, Box Batch = 3
  • highlight to user its already in the system and move on to the next box.

Thanks in advance for any hints or examples.

Respectfully, that assertion is inaccurate.

Please read and understand these:

1 Like