Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Clearing items from a Sharepoint List via powerapps

Hey, all!


I'm building a prototype PowerApp to help manage pool laptops. It's built from a list of available laptops in SharePoint, which is made up of several columns including computer name, common name, Recipient, Check-out Date, Return Due-Date, Reference Engineer, Request Reason.


The number of laptops is static, (so we don't need to add a new item to the list). But, there are several columns that include information that would be reset when the user returns the laptop. (i.e. Engineer Responsible, Recipient, Checkout Date, Return Date, Reason).


(I've added some pictures to this to give you a visualisation of what I mean.)


In short, I'm trying to find an appropriate way for our engineers to tick the relevant box in the gallery, then select returned to clear the Recipient, Engineer, Check-Out, Due-Date and Reason, so that it can then be reassigned using the form (that part seems to work fine).


So far I've played around with the Reset functions in PowerApps but I don't think this is the way forwards. I have started dabbling with the PowerAuto in order to achieve this, but I'm still quite green to it and not sure how I'd go about clearing or blanking specific columns in a row item (i.e. not clearing the computer name / common name).


Any ideas?


Cheers & Have a great day 🙂

Dual Super User
Dual Super User

I think what you are looking for is a simple Patch() statement in the OnSelect of the Returned button that clears the fields in the list.  For the checkbox set something in the OnChecked and OnUnChecked that sets or clears a variable to the value of the indexed field in the data source.  I'm assuming in your picture that is something like the 'UKL....' value that you display.  Then in the OnSelect do a Patch(datasourcename, Lookup(IDField=variable), {whatever values you want to reset})

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Community Support
Community Support

Hi @RhysD ,

Do you want to clear the  Recipient, Engineer, Check-Out, Due-Date and Reason column value for the selected item(s) within the Gallery?


Based on the needs that you mentioned, I think the Patch function and ForAll function could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

1. Turn on the "Formula-level error management" option within Advanced settings of App settings of your app.

2. Set the OnSelect property of the "Returned" button to following:

       RenameColumns(Filter(Gallery1.AllItems, CheckBox1.Value = true), "ID", "ID1"),
             'Your SP List',
             LookUp('Your SP List', ID = ID1),
                Recipient: Blank(),
                ReferenceEngineer: Blank(),
                CheckOutDate: Blank(),
                ReturnDueDate: Blank(),
                Reason: Blank()

Please take a try with above solution, check if the issue is solved.


Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey, that sort of helped - I did some editing using the online MS docs and now I've got the below:


Patch(PoolLaptopApp, (Gallery1.Selected), {Recipient: Blank(),ReferenceEngineer: Blank(),CheckOutDate:Blank(),ReturnDueDate: Blank(),Reason: Blank()})


This works, however I'm finding that if I select multiple entries and then hit returned, it only applies to the last entry selected. Any ideas how I might be able to remedy this so that it does it for all selected items? 


I did try:


ForAll(Patch(PoolLaptopApp, (Gallery1.Selected), {Recipient: Blank(),ReferenceEngineer: Blank(),CheckOutDate:Blank(),ReturnDueDate: Blank(),Reason: Blank()}))


But it returns the error "Invalid number of arguments: received, expected 2"


I'm not too sure what I'm missing.


All the best,


Patch() by definition applies to a single record.  There are ways to do it using ForAll(), but as you've seen those are tricky.  Instead I would take a look at the UpdateIf() function. UpdateIf() applies to any record that meets the criteria specified.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,425)