cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KKirsten
New Member

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
New Member

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
Community Support

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
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Users online (8,122)