Managing inventory or tracking assets using PowerApps becomes significantly more efficient when barcodes are introduced into the mix. By leveraging the barcode scanning capabilities within PowerApps, users can quickly retrieve information from a SharePoint list—or seamlessly create a new entry if the scanned barcode doesn’t already exist.
I was recently working on a PowerApps Scan Barcode inventory app where I could scan a number of barcodes for a collection. This allowed me to perform a bulk update on the collected barcodes. For each item that was scanned, the app performed a lookup and would match an existing item from a SharePoint list.
But what if one of these items was for some reason not in the SharePoint list? I spent a lot of time trying to find a solution whereby if the scan was not found in the SharePoint list it will force the user to create the item by sending them to a new screen where the item can be created.
PowerApps Scan Barcode App
Here is the Solution –
The formula for Button’s OnScan property :
If( !IsBlank( LookUp( colScannedItems, Value = BarcodeScanner2.Value )), Notify(“Scanned Barcode Already Exists”), If( IsBlank( LookUp( ‘Asset Database’, ‘Asset Number’ = BarcodeScanner.Value)), Collect( colScannedItems, {Value: Value(BarcodeScanner.Value)}); Navigate(Screen2) ));
