Mobile Inventory with Power Apps Barcode Scan
Track stock, process receipts, and update product details on the go using nothing more than the camera on your phone.
When a retail warehouse needs to move fast, tap-and-type interfaces slow everyone down. A barcode scanner control turns any phone or tablet into a purpose-built data capture device. Instead of searching for product codes, staff can scan, see details, and update quantities instantly. Building this kind of tool doesn't require a big budget — just a SharePoint list, a simple canvas app, and the built-in media controls.
This walk‑through uses a Contoso Electronics scenario. The store keeps an inventory of laptops, tablets, and accessories. Associates scan items to view product info, adjust stock, and receive new shipments in bulk.
Designing the Data Foundation
Start by creating a SharePoint list to hold your inventory. A list gives you a secure, multi‑user back end without any extra infrastructure.
Create a new list named Electronics Inventory and add these columns:
| Column Name | Type | Purpose |
|---|---|---|
| ProductName | Single line of text | Friendly product title |
| Category | Choice | Laptop, Tablet, Accessory |
| BarcodeID | Single line of text | Unique barcode number (ISBN, UPC, etc.) |
| StockQuantity | Number | Current units on hand |
Populate the list with a few items so you can test scanning later. Here are some examples:
| ProductName | Category | BarcodeID | StockQuantity |
|---|---|---|---|
| MacBook Pro 14" | Laptop | 123456789012 | 12 |
| iPad Air | Tablet | 987654321098 | 25 |
| USB‑C Hub | Accessory | 456789012345 | 40 |
Performance tip: If your list will grow beyond 500 items, create an indexed column for BarcodeID. Lookup operations rely on this field, and indexing avoids delegation warnings.
Building the Detail Screen
The first screen a user sees after scanning should clearly show the product and let them edit the quantity.
-
Create a new phone canvas app from blank.
-
Rename the screen to ProductDetailScreen.
-
Add a label at the top for a title (e.g., “Product Details”).
-
Insert an Edit form and connect it to the Electronics Inventory data source. Set its
Itemproperty to a variable that will hold the current record:powerfxEdit form ItemvarActiveProduct
Because the variable doesn’t exist yet the form will show a red error — that’s normal.
-
Add a Barcode scanner control and a camera icon on top of it. The camera icon triggers the scan. Style the scanner to look like a button:
Align: Right BorderStyle: None Color: White Fill: RGBA(0, 134, 208, 1) RadiusTopLeft: 180 RadiusTopRight: 180 RadiusBottomLeft: 180 RadiusBottomRight: 180 Width: 64 Height: 64
Scan and Look Up
When a barcode is scanned, the app looks up the product in SharePoint. If found, the form displays the data; if not, the app notifies the user.
Wire the following code to the OnScan property of the scanner control:
Set(
varActiveProduct,
LookUp(
'Electronics Inventory',
BarcodeID = btnScanner.Value
)
);
If(
IsBlank(varActiveProduct),
Notify("Product not found", NotificationType.Error),
(ResetForm(frmProduct); EditForm(frmProduct))
)Add a Select() call to the camera icon’s OnSelect to start the scanner:
Select(btnScanner)
Now you can test the scan flow in preview. When a known barcode is scanned, the form should fill with the correct product.
Managing Stock Adjustments
Once a product is loaded in the form, staff can update the quantity and save changes.
Place a Save button in the title bar and put this code in its OnSelect:
SubmitForm(frmProduct)
After the form submits, the variable should be refreshed so the screen shows the latest quantity. Use the form’s OnSuccess property:
Set(varActiveProduct, frmProduct.LastSubmit); Notify( "Saved: " & varActiveProduct.ProductName, NotificationType.Success )
Everything works because LastSubmit contains the record that was just written, including the new StockQuantity.
Creating a Master List Screen
A list view lets users browse the whole inventory and tap an item to jump to the detail screen.
-
Add a blank screen named ListScreen.
-
Add a label with the title “Inventory List”.
-
Insert a Vertical gallery connected to Electronics Inventory.
-
Inside the gallery, add two labels:
- One to show product name, category, and barcode:
powerfxGallery label – details"Name: " & ThisItem.ProductName & " | " & ThisItem.Category & " | " & ThisItem.BarcodeID
- Another to show the stock quantity:
powerfxGallery label – quantityThisItem.StockQuantity
When a user taps an item in the gallery, navigate to the detail screen with that product loaded. Write this in the gallery’s OnSelect:
Set(
varActiveProduct,
LookUp(
'Electronics Inventory',
BarcodeID = ThisItem.BarcodeID
)
);
EditForm(frmProduct);
Navigate('ProductDetailScreen')Add a back button on the ProductDetailScreen to return to the list:
Navigate('ListScreen')Barcode Scan from the List
Because the list screen is the home screen, add a Barcode scanner there too. Follow the same pattern as before — place a scanner and a camera icon, keep the code in OnScan identical but use the scanner’s own name:
Set(
varActiveProduct,
LookUp('Electronics Inventory', BarcodeID = lstScan.Value)
);
If(
IsBlank(varActiveProduct),
Notify("Product not found", NotificationType.Error),
(EditForm(frmProduct); Navigate('ProductDetailScreen'))
)Receiving Bulk Shipments
Warehouse receipts often involve scanning many items of the same product in a row. The app can stay in a continuous scan mode and increase the quantity by one each time a valid barcode appears.
- Add an Add icon on the top‑right of ListScreen.
- Insert another Barcode scanner and set its Visible property to
false. - Code the invisible scanner’s
OnScanas follows:
Set(
varActiveProduct,
LookUp('Electronics Inventory', BarcodeID = recvScanner.Value)
);
If(
IsBlank(varActiveProduct),
Notify("Item not found", NotificationType.Error),
Set(
varActiveProduct,
Patch(
'Electronics Inventory',
varActiveProduct,
{StockQuantity: varActiveProduct.StockQuantity + 1}
)
);
Notify(
"Increased stock of " & varActiveProduct.ProductName & " by 1.",
NotificationType.Success
)
);
Select(recvScanner)This code loops: when a scan finishes, it immediately opens the scanner again via Select(recvScanner). The associate keeps scanning while the app automatically increments each product. Pressing Cancel on the scanner stops the session.
Pro-tip: On a real device, the scanner shows a blue overlay while active. The app remains responsive, so a user can cancel at any time.
Troubleshooting and Best Practices
Scanners don't respond
Make sure every variable referenced in OnScan exists. If you get a blue‑underlined error in the formula bar, set the variable explicitly on app start or screen OnVisible.
Delegation warnings for LookUp
When a SharePoint list grows beyond 2,000 items, a non‑indexed lookup falls back to a non‑delegable filter. Add an index on the BarcodeID column and use that column in the search.
Camera permissions The barcode scanner requires camera access. If the scanner doesn't start on a physical device, check the device permissions under Settings > Privacy > Camera.
Form not refreshing after save
Always call ResetForm() before EditForm() to clear the previous record’s state. The code in the scan flow already does this.
Scanner not re‑opening in batch mode
The Select(recvScanner) call must happen after the Patch completes; otherwise the scanner may start before the variable updates. The order shown in the bulk‑receive code handles this correctly.
Final Recommendation
Power Apps barcode scanning turns a phone into a practical, low‑cost inventory tool. With just two screens, a SharePoint list, and a handful of formulas you can cover the core warehouse flow: look up, update, and bulk receive. The same pattern works for asset tracking, library check‑out, or field equipment management.
If the business requires approval workflows or email notifications after a receipt, connect this app to a Power Automate flow triggered by the OnSuccess event. That keeps the app lean while still integrating with broader processes.
References
- Original article by Matthew Devaney: Power Apps Barcode Scanner
- Microsoft Learn: Barcode scanner control in Power Apps (check for latest updates)
- Microsoft Learn: Understand delegation in Power Apps
Learn how small coding practices—like using descriptive names, flattening conditions, and simplifying logic—can make your apps easier to update and less error-prone.
Move past the gallery and discover the hidden patterns for validation, navigation, and smart submission handling in your data entry forms.
PowerShell unlocks admin capabilities that the Power Platform admin center simply doesn’t offer—from recovering deleted apps to blocking trial licenses. Here’s how to wield them safely.