I'm trying to create a flow that activates when a date is added to a column in one SharePoint list and adds that date as an event on a separate SharePoint calendar or modifies an existing calendar event if the date has changed. My problem is that I'm using Get Items to search the calendar for existing events and then a condition to test whether those events have the same name. But because of the Apply to Each loops on each returned item, my actions after the condition occur multiple times.
So the first part all works. When someone modifies the date column in the first list, the flow triggers and Gets Items from the calendar, filtered on the correct category for the type of event.

The problem is in the second half. I want the flow to check if the existing calendar items match the title of the list item with the changed date. If there is a matching existing calendar item, I want to update it. If there is not an existing calendar item, I want to create one. What happens is, the flow creates duplicate calendar items, one for each of the Get Items values it has collected, because the entire condition applies to each Get Items value. How do I get it to only modify or create a single calendar entry?

And then a second question is, what can I add to the flow to have it delete an existing calendar entry entirely if the date is deleted from the SharePoint list rather than modified?
Thanks for your help!