cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
sharethepoint
Level: Power Up

Deleting a list item via app, moving item to recycle bin

Hi

 

I have a simple app that connects to a SharePoint list, when I delete an item via the app it removes the item from the list but it doesn’t move it to the site recycle bin (it does if I delete an item in the list itself)

 

How can I set the item to move to the recycle bin when deleting via the app?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Deleting a list item via app, moving item to recycle bin

I am using a Sharepoint "Delete Item" action in MS Flow, and have confirmed that the deleted file is in the recycle bin.  I would verify this for yourself, since other settings may affect this, but at least Flow has the potential of doing what you wish.  Plus, you have the other benefits of notifications that you could trigger when something is deleted.  Even if it is just to an admin, or someone to keep an "eye" on who and what is being deleted.

 

My list type for this example was a document.  There was a PDF file with it.

View solution in original post

11 REPLIES 11
Community Support Team
Community Support Team

Re: Deleting a list item via app, moving item to recycle bin

Hi,

 

I have confirmed this.

If we click the Remove Icon under the details screen of the list, then the list item would be removed, and can't be restored from the recycle bin.

 

The formula used under the remove icon is:

Remove('Testing list', BrowseGallery1.Selected); If (IsEmpty(Errors('Testing list', BrowseGallery1.Selected)), Back())

The explanation from the PowerApp formula reference article for this function is:

Remove – Removes one or more specific records from a data source.

Currently I can't find any function available in the formula list which would obey the deleting rules defined in SharePoint.

I will report this from my side, hope there would be update on this part soon.

Regards

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

Re: Deleting a list item via app, moving item to recycle bin

I am using a Sharepoint "Delete Item" action in MS Flow, and have confirmed that the deleted file is in the recycle bin.  I would verify this for yourself, since other settings may affect this, but at least Flow has the potential of doing what you wish.  Plus, you have the other benefits of notifications that you could trigger when something is deleted.  Even if it is just to an admin, or someone to keep an "eye" on who and what is being deleted.

 

My list type for this example was a document.  There was a PDF file with it.

View solution in original post

PytByt
Level 8

Re: Deleting a list item via app, moving item to recycle bin


@v-micsh-msft wrote:

Hi,

 

I have confirmed this.

If we click the Remove Icon under the details screen of the list, then the list item would be removed, and can't be restored from the recycle bin.

 

The formula used under the remove icon is:

Remove('Testing list', BrowseGallery1.Selected); If (IsEmpty(Errors('Testing list', BrowseGallery1.Selected)), Back())

The explanation from the PowerApp formula reference article for this function is:

Remove – Removes one or more specific records from a data source.

Currently I can't find any function available in the formula list which would obey the deleting rules defined in SharePoint.

I will report this from my side, hope there would be update on this part soon.

Regards


Hi @v-micsh-msft ,

 

is there a way or a furmula that i can use to archiving a record from SP list instead of deleting it using powerapps?

 

thanks,

pytbyt

Super User
Super User

Re: Deleting a list item via app, moving item to recycle bin

@PytByt ,

 

There are various ways you can take a record from one list, and copy that record to another list (including files too, if it is a document list).  I have done this with MS Flow routines.  I have a pending submission list for PDF files that sit in a queue, then when approved, it copies the file from that list into another list, then deletes the one from the pending list.  You can do it in PA as well, but I find it a little easier, and it is easier to track in Flow.  In my opinion.  

 

Let me know if you need any assistance.

PytByt
Level 8

Re: Deleting a list item via app, moving item to recycle bin

@martinav 

 

i indeed need your assistences. 

i need the exact formula and the methode how to instead of deleting it, we archieving it in another SP list. 

 

this i ask because i just recently learn powerapp. 

 

please help me.

 

thank you,

regrads.

 

pytbyt

Super User
Super User

Re: Deleting a list item via app, moving item to recycle bin

@PytByt ,

 

I am going to help as much as possible.  What I would like to do is to refer you to some very good help tutorials on youtube. @Shanescows has done an amazing job putting together some very detailed and informative videos on specific subjects.  Some of which will show you how to create and delete sharepoint.  The syntax and such is the hardest, in my opinion, because formal documentation of powerapps is so very lacking.

 

I'll start you off with this video regarding the Patch() command and Collect() that will help you greatly with making a new sharepoint item from one list and copying the information to a new list. (i.e. archiving)

 

https://www.youtube.com/watch?v=MclJ_O9HvJQ

 

Watching these videos will give you more information you need in a lot of ways, but the tips you will learn will help you tremendously.  

 

 

Super User
Super User

Re: Deleting a list item via app, moving item to recycle bin

I forgot to ask... is this just a list, or a document list?  A document list will likely require a MS Flow routine.  But, its quite doable.

PytByt
Level 8

Re: Deleting a list item via app, moving item to recycle bin


@martinav wrote:

I forgot to ask... is this just a list, or a document list?  A document list will likely require a MS Flow routine.  But, its quite doable.


@martinav 

its a record from SP list.

 

the idea is i want to move the record from SP List 1 to SP List 2 instead deleting it into recycle bin.

 

is it possible to do? how?

 

thanks.

Super User
Super User

Re: Deleting a list item via app, moving item to recycle bin

@PytByt ,

 

The short answer is no.  Not to my knowledge.  However, commands in PowerApps and/or Microsoft Flow can copy the existing record, create a new record in the archive list, then delete the old record in the old list.  You can have either Flow or PowerApps do a verification that the record exists in both lists before deleting the old.  I'm guessing that is why you dont want to do a delete.  I can understand the uncomfortable feeling of having the system delete one of your reccords.  The quick system check should relieve any risk from that action.  It is not impossible that the record may not copy correctly just due to the occasional (more frequent than it should be) overall system problems.  No check would be risky.

 

I do not use the workflow features in SP, so I am not sure about how to copy that historical information, or if it can be.  If that is an issue, then that needs to be investigated further.  I build in workflow history in my lists with approver name and approval date columns.  I find that to work quite well.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 341 members 5,806 guests
Please welcome our newest community members: