cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jlbaker
Regular Visitor

SharePoint "When an item is deleted" trigger - access metadata of deleted item

Hi there,

 

I'm trying to access the metadata of a deleted item.  However, the Dynamic content under "When an item is deleted" consists only of Deleted by, Filname with extension, ID, Is folder, Name, and Time deleted.

 

I tried Get Item with the ID.  That failed of course with an Item not found because the item was already deleted and in the recycle bin.

 

I also tried a Send an HTTP request to SharePoint with a GET for the RecycleBin but that just returns similar metadata as When an item is deleted.

 

I noticed that a couple new Dynamic content items appear under When an item is deleted when you click in a comparison field of a Condition step.  They are Item and List of Deleted items.  Searching as proved fruitless as to what these fields do, how to use them, and will they do what I want them to do.  Do you have any insight?

 

The only other option I thought of is to restore the item from the recycle bin, get its metadata, and then delete it again.  But again, I wasn't able to find any search results.  Any tips here?

 

Any other ideas on how to tackle this problem?  I'm not really interested in writing the metadata I need into the Title field.

 

Thank you!

7 REPLIES 7
yashag2255
Dual Super User II
Dual Super User II

Hi @jlbaker 

 

There is a bug that has been identified in the When an Item/ File is deleted trigger for SP and some of the information is missing from the body when the flow is triggered. the bug is already raised here:https://powerusers.microsoft.com/t5/I-Found-A-Bug/When-a-file-is-deleted-SharePoint-action-not-retri... and should be fixed soon in the next releases. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Thank you, yashag, for the quick response. I am experiencing the missing information in the body issue you mentioned. However, that is of way less concern than getting at the metadata of the deleted item. It doesn’t look like the item’s full metadata is available in the body by design for this trigger, only the subset. So, I am needing an alternate way of getting the item’s full metadata. Therefore, do you happen to have any input on the questions in the later part of my post…

 

“I noticed that a couple new Dynamic content items appear under When an item is deleted when you click in a comparison field of a Condition step. They are Item and List of Deleted items. Searching has proved fruitless as to what these fields do, how to use them, and will they do what I want them to do. Do you have any insight?

 

The only other option I thought of is to restore the item from the recycle bin, get its metadata, and then delete it again. But again, I wasn't able to find any search results on how to do this. Any tips here?

 

Any other ideas on how to tackle this problem? I'm not really interested in writing the metadata I need into the Title field, which is available in the subset.”

 

Thank you.

Did you ever find a solution to getting the additional fields of the item that is being deleted? I am trying to capture the details of the deleted item, but I am only given Name, Filename and Deleted By. Thank you in advance for any information you can provide.

Ulf_W
Frequent Visitor

hey@all,

 

i have the same problem. Need a value of the metadata/properties of the deleted item to work with it in another application. So is there anyone who can tell me the way to go?

mizsei
Advocate I
Advocate I

I think there is no option for that. I have built an excel, where I save every row, and when an item is deleted I can search it from the excel and get the metadata. 

This is not a nice workaround, but at least it works. 😞

No.. but it is definitely a workable solution! ++ you can restrict/add perms to files. 
sometimes simple is genius! cheers!

mizsei
Advocate I
Advocate I

I wondered, if I didn't allow deletion, but create a deleted yes/no field, and I only SET an item to deleted. But this isn't the best method either.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,499)