web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / When an event is updat...
Power Automate
Unanswered

When an event is updated I want to either delete and create a new event or update and existing one

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I'm trying to figure out how to create a flow which reads when an event is updated in google Calendar, and then finds a related event and either deletes it and creates a new one, or updates the existing one.

I have tried a few different things but when ever I try and update or delete event2 it comes up with an error saying the event could not be found.

 

Example 1:

"Surgery 'Variable1'" event1 is updated

get event2 containing "Dispatch 'Variable1'"

Delete event

create new event3

read date event1 has been updated to add new event3 a set amount of days before

 

Example 2:

"Surgery 'Variable1'" event1 is updated

get event2 containing "Dispatch 'Variable1'"

 

Update event2

read date event1 has been updated to and update the day event2 is on.

 

Thanks in advance for any help

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    Could you please show a bit more about the "Surgery 'Variable1' " and the "Dispatch 'Variable1' " that you mentioned?

    Could you please share a screenshot of your flow's configuration?

    Further, how do you find the related event within your flow?

     

    I suppose that you want to find the related Google calendar event whose Title has the key value Dispatch Variable1 within your flow, delete the related event and create a new event or update the existing one. Is it true?

     

    I have made a test on my side and please take a try with the following workaround:

    • Add a "When an event is updated in calendar" trigger.
    • Add a "List the events in calendar" action, Min Time field set to following formula:

     

    utcNow()

     

    • Add a "Apply to each", input parameter set to output of "List the events in calendar"
    • Within "Apply to each", add a Condition, left input box set to Event List Event Title dynamic content of the "List the events in calendar" action, right input box set to Dispatch Variable1.

             Within "If/yes" branch of Condition, add a "Delete an event" action and then add a "Create an event" action.

     

    Note: The variable1 of key value "Dispatch Variable1" is not wrapped with single quotation (') on my side, if I remain the single quotation, when I click "Edit in advanced mode", the variable1 would be wrapped with double quotes automatically:19.JPG

    But the variable1 that the google calendar event contains is wrapped with single quotation, so the result the Condition box evaluates would be false continuously.

     

    The single quotation mark is the only way to wrap string literals within expressions of Microsoft Flow, you cannot use double-quotes inside expressions because this punctuation conflicts with the JSON quote that wraps the whole expression. 

     

    Image reference:16.JPG

     

    17.JPG

    The flow works successfully as below:18.JPG

     

    If you want to find the related event via condition that I provided above, please remove the single quotation which wraps the variable1.

     

     

    Best regards,

    Kris

     

     

     

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @v-xida-msft,

     

    So the variable isn't really a variable defined in the flow, it is just a code which is different for each Surgery date, and then using a different flow, I have made one which creates an event replacing SURGERY with DISPATCH.When I add an event containing SURGERY, it creates a Dispatch date a set number of days beforeWhen I add an event containing SURGERY, it creates a Dispatch date a set number of days beforeThis is the flow which adds the eventsThis is the flow which adds the eventsIn this one I'm trying to find the event which has the DISPATCH, but also has the same ending as the one which was updatedIn this one I'm trying to find the event which has the DISPATCH, but also has the same ending as the one which was updated

    The dynamic function I'm using in the last image is this: 

    replace(triggerBody()?['summary'],'SURGERY','DISPATCH')
     
    Even just getting an event it gives the correct input, but it gives an error message saying it couldn't be found.
    Finds the correct input name, but it gives an error 404 message saying it can't be foundFinds the correct input name, but it gives an error 404 message saying it can't be found
    Using the example you suggested it still comes up with the same error messageFlow failed.JPG
     
    It just seems odd that it has the correct input name but then can't find the event in the calendar.
    Hopefully you can make some sense of what I'm trying to do
     
    Best Wishes
     
    Robyn

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 251 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 239

#3
Expiscornovus Profile Picture

Expiscornovus 220 Most Valuable Professional

Last 30 days Overall leaderboard