Mar 27 2019 06:21 AM
Hello everybody,
I have two lists in sharepoint online named Training & Registrations. In the Training list, I have add a few training names with a count of available seats (standard 15). In the Registrations list, I add a person with a training to the list. On the background the count of available seat is for that training set to 14 (15 - 1 for the just added person).
My question is: When I delete the person in the registrations list, the available seats in the training list need to be changed to 15 again. How can I do that? My first step in the flow needs to be When an item is deleted. But what are the next steps?
I hope anyone can help me with this problem?
Kind regards,
Jeroen Laurijsen
Apr 23 2019 11:12 PM
Hi @JeroenLaurijsen,
The problem I see with this scenario unfortunately is that using the "When an Item is Delete" step is VERY limited. The output from that trigger gives you no useful information on the deleted item. And while it DOES provide you the item's ID, using a follow-up 'Get Item' using that ID returns nothing (which makes sense... since the item is deleted. I hoped beyond hope Microsoft would somehow cache the values for us).
So trapping the DELETE event in Flow won't help.
An alternative, however, is to take over the delete altogether.
I didn't draw up the entire Flow, but here is the trigger and some placeholders for direction:
And because you used the For a selected item trigger and pointed it to your Registrations SharePoint list, when you navigate to your list and select a single item, when you click the FLOW menu, you will have a "Delete Registrations" option to trigger your flow.
I'd rather have the standard delete just work, but this is a viable alternative if you don't mind clicking a different DELETE button.
Let me know if this helps.