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

Send mail if Sharepoint list item is delted

Hey.

 

i'm trying to built an easy flow, which sends an e-mail out, if an item from a sharepoint list is deleted. The e-mail should be send to the creator of the deleted list item.

 

2019-05-17 13_46_47-Run History _ Microsoft Flow.png

 

My current flow fails with a 404 Error "Item Not Found" at the GetItem action. I'm guessing i try to get values of an already deleted item. 

 

Is there any other way to accomplish this task?

 

Greetings

3 REPLIES 3
Super User
Super User

Re: Send mail if Sharepoint list item is delted

Because the When an item/file is deleted are triggers, you are limited on what you can capture from them. Currently, When an item is deleted triggers it only captures six parameters for use

When an item is deleted it it offers six parameters to use within the Send an email (V2) action (see the subject and body areas):

WhenItemIsDeletedSendEmail.PNG

When a file is deleted it offers six parameters to use within the Send an email (V2) action (see the subject and body areas):

WhenFileIsDeletedSendEmail.PNG

If you'd like expanded built-in functionlity added to Flow, please consider submitting it to the Flow Ideas page, where it can be voted on by other users, and tracked and commented on by the Flow team.

You do have some alternatives, however. The connector does have a DeletedItemList Parameter available to it. So, you can invoke it as an Object Variable for usage within your Flow (such as passing it through to the email).

VariableDeletedItemList.PNG

You'd have to do some testing to see what the DeletedItemList variable returns. If it does return the item creator, then you could grab that and also pipe it into the Send an email. 

For more information on how to utilize variables, review the Create variables for saving and managing values in Azure Logic Apps documentation

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!

KKirsten
Level: Power Up

Re: Send mail if Sharepoint list item is delted

hey @Brad_Groux ,

 

thanks for your reply!

If i did everything correctly, these should be the values of that variable:

 

{"ID":12,"Name":"Test","FileNameWithExtension":"Test","DeletedByUserName":"My Tesuser name","TimeDeleted":"2019-05-18T09:06:22Z","IsFolder":false}

Is there a function to get the user e-mail by username? Could be buggy though, if there a two employees with the exact same name.

 

Greetings!

Community Support Team
Community Support Team

Re: Send mail if Sharepoint list item is delted

Hi @KKirsten ,

 

Basically, if this item has been deleted, then we can't get information about the item's Creator because the item doesn't exist anymore.

 

Perhaps you could consider using the following methods to achieve your requirements.

  • We need to create an additional list to store the information in the original list, similar to a lookup list.
  • This list needs to add two fields, one is used to store ItemID in the original list, and the field type is Number.
  • Another field is used to store the email of Creator contained in the item.
  • In addition to creating an additional list, we need to configure an additional Flow to add the items from the original list to the lookup list.

 

Lookup list:

17.PNG

Additional Flow:

15.PNG

Flow used to send email:

16.PNG

 

Hope it helps.

 

Best Regards,

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

Helpful resources

Announcements
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 (6,199)