Microsoft PowerApps: Beginner’s Guide to the Patch function
3 min readAug 15, 2023
Introduction
In Microsoft PowerApps one of the key things you will need to learn is how to create and update records in a data source.
To achieve this, there is a function called “Patch”. In this beginner’s guide I will show you how to use it.
Lets consider the following scenario:
We have an app to log inventory items for an IT department. In the app we have:
- inventoryList = A connected data source which is a SharePoint list
- inventoryItems = A Gallery (left of screen) that displays any data from our data source
- nameInput = A text input field
- quantityInput = A text input field
- saveButton = A button for the user to click
Here is a screenshot for reference:
1. Adding a new item to the inventory
In the first instance we may want to add a new item to the inventory, to do this we can use Patch, and add a formula to the “OnSelect” property of our button.
When the user clicks the button we want to add a new item to the inventoryList using the input values for name and quantity.