Practical case / Store and inventory control

02 · Store: create a stock and counting app

Build an application to browse products, see what needs restocking and correct physical counts without returning to a spreadsheet.

·

75–100 minutesIntermediate level
What you will build
Canvas app with a catalog, restocking filter and stock-count form.
Tools
Power Apps · Dataverse · Power Fx
On this page · 7 sections

The work you will simplify

A Barrio Demo staff member walks the shelves when the store opens. They need to identify each item, see its location, and record the physical count. The app will also show products at or below minimum stock.

This version supports a controlled single-operator stocktake. A system deducting simultaneous sales needs inventory movements and server-side concurrency control; subtracting a number from several phones is insufficient.

1. Create the working screen

In the case 01 solution, create a canvas app named Barrio Demo Stock, using tablet format. Add the tables Tienda Productos and Tienda Proveedores as Dataverse data sources.

Split the screen into two areas: catalog on the left and product details on the right. Use classic controls so the indicated property names match.

Insert a vertical gallery named galProductos. Its property Items will be:

'Tienda Productos'

Inside the template, display:

Label Text property
Code ThisItem.SKU
Item ThisItem.Producto
Location ThisItem.Ubicacion
Units ThisItem.Existencias

Check all eight codes before adding more logic.

2. Show products requiring replenishment

Add a classic toggle named tglReposicion, with the text Products to replenish only. Change the gallery's Items:

If(
    tglReposicion.Value,
    Filter('Tienda Productos', Existencias <= Minimo),
    'Tienda Productos'
)

Examples use commas as separators. If your editor uses semicolons, replace argument commas with semicolons.

Enabling the toggle should leave four items, including LEC-1L, which is exactly at minimum stock.

This comparison between two columns may not delegate to the source. This case uses eight records. Review delegation warnings: for a large catalog, resolve the indicator at the source or through a delegable query, and check it with more records than the local limit.

3. Add the details and stock count

Insert an edit form named frmStock:

  • DataSource: the Tienda Productos table.
  • Item: galProductos.Selected.
  • Fields: SKU, Producto, Existencias, Minimo, Precio, Ubicacion, and Proveedor.

Keep the generated Dataverse cards, especially the supplier lookup. Add these buttons:

Button OnSelect
Edit stock count EditForm(frmStock)
Save stock count SubmitForm(frmStock)
Discard changes ResetForm(frmStock)

In OnSuccess for the form, use Refresh('Tienda Productos'). Refresh must occur after a successful save. Add a label below with Text set to frmStock.Error to display errors.

Do not navigate away or display Saved immediately after SubmitForm. Submission can take time or fail.

4. Run a complete stocktake

  1. Select CAF-250 and verify its initial four units.
  2. Select Edit stock count. Enter 9 because you found a box at location A-01.
  3. Save and check the row directly in Dataverse.
  4. Enable the replenishment filter: ACE-1L, LEC-1L, and GAL-200 should remain.
  5. Edit LEC-1L, enter 20 and discard changes. Its saved value must remain 12.
  6. Try saving a negative quantity and verify rejection.
  7. Close and reopen the app. CAF-250 must retain 9, rather than return to 4.

The unit total after saving only the coffee change will be 106.

Case deliverables

Submit the app, a screenshot of the filter with three results, and the persisted CAF-250 row. Record the environment and connection used. Before sharing with other employees, configure both app access and data permissions; maker permission does not grant every Dataverse privilege.

Restore coffee stock to 4 if you will compare results with the original catalog in other cases.

Official documentation

Documentation checked on October 18, 2026. Execution in a Microsoft environment: pending verification.

The conversation continues here

Questions and experiences

Stuck on a step or found another way? Share what you have tried and help those who come after you.

Read comments or sign in to participate.

Loading comments…