PowerApps: simple shopping cart

Here is a simple way to implement a shopping cart in your PowerApp, just follow the steps below.  I will demostrate with some sample data.  The selected items will be added to or removed from the ShoppingCart collection as the user clicks on the check box.  You can then use this collection elsewhere in your app, for example to submit orders once confirmed.

  1. Create a blank app
  2. Insert a two blank vertical galleries in your screen
  3. Set the Items property of the first gallery to:
    ["Item A", "Item B", "Item C", "Item D"]
    (This will be a one-column table with column name “Value”)
  4. Insert a label in the first gallery’s template and set its Text property to:
    ThisItem.Value
  5. Insert a check box in the first gallery’s template
  6. Set the Text property of the check box to:
    ""
    (This gets rid of the annoying default text)
  7. Set the OnCheck property of the check box to
    Collect(ShoppingCart, ThisItem)
  8. Set the OnUncheck property of the check box to
    Remove(ShoppingCart, ThisItem)
  9. Set the Items property of the second gallery to
    ShoppingCart
  10. Insert a label in the second gallery’s template and set its Text propery to
    ThisItem.Value

That is all you need, completed demo is shown below.

Click ShoppingCart to download the PowerApp demo file.

Leave a Reply

Your email address will not be published. Required fields are marked *