cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
joe904
Helper I
Helper I

Flow Assistance: When an item is deleted

Hey Guys,

 

I am working on a flow that when an item is deleted from a SharePoint List that it notifies me using email, and at the same time it takes the item details and moves them to another SharePoint List of where I will keep these deleted items. I have tried using the Get Items connector but it seems to focus more on the adding of items. Any help is much appreciated....

 

4 REPLIES 4
Pstork1
Dual Super User III
Dual Super User III

I'm not sure this is going to be possible.  The problem is that the item is already in the Recycle Bin by the time the flow triggers, so there is no way to get the actual details of the item that was deleted.  There are HTTP REST calls that can do that, but I can't find a way to use them without the GUID of the object in the recycle bin and that isn't provided by the delete trigger.

 

So you can definately use a trigger on deleted items to send an eamil, but there is no way to get anything except the basic properties.  You also need to be a site collection admin for that to work.  Otherwise those properties will also be blank.



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

@joe904 

I agree with the comments provided by @Pstork1 but would like to suggest another approach.  You can create a custom permission level in SharePoint that allows your users to create/edit items but not delete them.  If you go this route, add check box (yes/no) column to the list titled "Delete this item".  When the item is saved and the Delete box is checked, your Flow can copy the data over to the archive list and then delete the existing item.

If you need help with this, please post here.

 

 

 

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

Scott

Thanks for the input @Pstork1 and @ScottShearer.

That is a really good idea @ScottShearer. I do not think I could use the Yes/No since it seems the functionality is more for a form. I am directly using the list to add (New) and delete. When I added the column, the Yes/No did not show up in the list view. I was searching online and found this posting of creating a column and then adding some JSON code into the column. It is basically a clickable link that connects to my workflow using the workflow's ID.  It works fine, it calls my workflow with no issues, but maybe it is my lack of expertise with JSON and workflow, but I keep getting an error in my workflow. I have a simple Manual Trigger with a Send email action. I keep getting this error. I appreciate your continuing assistance.

 image3.jpg

 

image1.jpg

Here is the JSON that I used. 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "span",
  "style": {
    "color": "#0078d7"
  },
  "children": [
    {
      "elmType": "span",
      "attributes": {
        "iconName": "Flow"
      }
    },
    {
      "elmType": "button",
      "style": {
        "border": "none",
        "background-color": "transparent",
        "color": "#0078d7",
        "cursor": "pointer"
      },
      "txtContent": "Click Here To Delete",
      "customRowAction": {
        "action": "executeFlow",
        "actionParams": "{\"id\": \"2a330326-7d33-4dde-b956-af26e57906ba\"}"
      }
    }
  ]
}

 

 

Pakocha
New Member

You can add a new column to the item line wich is called "Delete", this new column can have two value (yes/no), and the first value is always no. When the user would like to delete, he must to change this column to yes, and so, you have all the details of the item, because the file is not delete. Then you can use the details, and when you finish the flow can delete the item.

 

easy and work¡

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,354)