This Microsoft Power Apps tutorial will teach us how to remove a SharePoint list item from the Power Apps Gallery. Then, we will discuss the Remove() function to remove the SharePoint list item from the Power Apps Gallery control.
Additionally, we will see how to use the RemoveIf() function to remove a specific SharePoint list item from the Power Apps Gallery.
Delete a SharePoint list item from Power Apps Gallery
Here, we will discuss how to delete a SharePoint list item from the Power Apps gallery.
Example:
I have a SharePoint Online list, i.e., [Issue Traker] and this list contains the below fields.
Column Name | Data Type |
Issue Title | Default single line of text column |
Product Name | A single line of text column |
In Power Apps, there is a Gallery control that is connected to the SharePoint list. When a user removes an item from the Power Apps gallery, it will also be removed from the SharePoint list.
Refer to the below screenshot:
To achieve the above example, follow the below steps.
1. Open Power Apps -> Create Power Apps Canvas app -> Connect to the SharePoint list to the app like below.
2. On the Power Apps Screen -> Insert a Gallery control and set its Items property as:
Items = 'Issue Tracker'
Where,
- ‘Issue Tracker’ = SharePoint Online List
3. Insert a Trash icon inside the gallery control and set its OnSelect property code like below.
OnSelect = Remove('Issue Tracker',ThisItem)
Where,
- Remove() = This Power Apps Remove() function is used to remove a specific record or records from a data source
- ‘Issue Tracker’ = SharePoint List
- ThisItem = We can select a specific item that we want to remove from the SharePoint list
4. Save, Publish, and Preview the app. Whenever the user clicks on the Trash icon, it will remove the SharePoint list item from the Power Apps gallery, as in the screenshot below.
This is how to remove a SharePoint list item from the Power Apps gallery.
Remove Specific SharePoint List Item from Power Apps Gallery
Next, we will see how to remove a specific SharePoint list item from the Power Apps Gallery using the RemoveIF() function.
Example:
I will also use the SharePoint list [Issue Traker] for this example. I have Gallery control in Power Apps, having the SharePoint list records.
Now, I want to remove specific SharePoint items based on the value, i.e., [Laptop] from Power Apps gallery control, as in the screenshot below.
To do so, follow the below-mentioned steps. Such as:
1. On the Power Apps Screen -> Insert a Button control (Remove Laptop) and set its OnSelect property as:
OnSelect = RemoveIf(
'Issue Tracker',
'Product Name' = "Laptop"
)
Where,
- RemoveIf() = This function is used to remove a specific item or items based on the condition
- ‘Product Name’ = “Laptop”= It is a logical condition to remove specific items based on the product name
2. Now, click the button control to remove the “Laptop” related issues from the Power Apps gallery to the SharePoint list.
3. Similarly, you can remove specific SharePoint items based on respective product names, i.e., [Remove Mobile] and [Remove Outlook]. To do so, follow the below button control’s OnSelect property:
OnSelect = RemoveIf(
'Issue Tracker',
'Product Name' = "Mobile"
)
RemoveIf(
'Issue Tracker',
'Product Name' = "Outlook"
)
This is how to specific SharePoint items from Power Apps Gallery.
Conclusion
Whenever you want to remove a SharePoint list item from a Power Apps Gallery, you can use a Remove() or RemoveIf() function to delete a specific item.
I trust this Power Apps tutorial taught in detail information about how to delete a SharePoint list item from Power Apps Gallery control and Remove a Specific SharePoint item from Power Apps Gallery using RemoveIf().
You may also like:
- Power Apps Gallery Conditional Formatting
- Power Apps Filter Gallery By Last Month
- Power Apps Filter Gallery By Date
- Power Apps Select All Checkbox in Gallery
- How to Display SharePoint List Items in PowerApps Gallery?
- How to Add Attachments in Power Apps Gallery?
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com