Pergunta

I am trying to design an approval process for deleting items from a list, but barely I can find a step by step guideline for this. I was able to accomplish this process (i.e. approval) for create or modified easily. Please let me explain the problem.

I would like to keep history of deleted items and also have an approval process for deleting an item. If admin reject, then the deleted item must not be deleted.

First, I cannot find versioning for the deletion process.

Second, When I click on an item, and then click on delete, then item is deleted, without leaving any trace in the approval column (I expected this to be Pending, but the whole row just get deleted).

However, through designing the flow, I expect when the admin reject the process, the deleted item at least appears back in the list, while this does not happen. This is very critical and appreciate any help.

Screenshot of my workflow is as follows: enter image description here

enter image description here

enter image description here

Foi útil?

Solução

There is no such thing in SharePoint as "versioning for the delete process". When an item is deleted, the item and it's entire version history move to the recycle bin, and eventually disappear into oblivion.

You cannot hook an approval process to the delete process, and there wouldn't be any history to that either. If you trigger your Flow on item deleted, the item is already in the recycle bin by the time your actions run.

What you will want to do is implement your own "soft delete" process. This is a process often used in databases where a table is given a Boolean flag named something like isDeleted, and then all views and queries only return data where that flag is false, and when a user "deletes" an item, the code just marks that flag "true", so the data never gets deleted, but behaves as if it has.

First, create a custom permission level for users to retain contribute rights without delete privileges for this list.
Then create two yes/no columns, NeedsDeleted and IsDeleted. We're creating two separate columns because in SharePoint, it's the only way to track if a specific field just changed. Make sure to make the IsDeleted column hidden. Then instead of a separate Flow, add a conditional branch to your On Item Modified Flow, checking when NeedsDeleted 'equals' true and NeedsDeleted 'does not equal' IsDeleted, which means this branch will only be executed when a user checked the NeedsDeleted box. Inside that Flow condition branch, do your approval process, and if approved, then set IsDeleted to true.
Depending on how strictly you want to hide those "deleted" items, you can either make sure all your list views filter out items with this column set to true, or in your Flow you can set item level permissions on the item to remove Read permissions from everyone except Admins.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top