cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
joe904
Level: Powered On

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....

 

3 REPLIES 3
Dual Super User
Dual Super User

Re: Flow Assistance: When an item is deleted

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.
Super User
Super User

Re: Flow Assistance: When an item is deleted

@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
joe904
Level: Powered On

Re: Flow Assistance: When an item is deleted

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\"}"
      }
    }
  ]
}

 

 

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,079)