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

Community site session details

Session Id : U//OecJvcuTpOo8ykLJFJ6
Power Automate - Building Flows
Unanswered

Calendar event triggered twice

Like (0) ShareShare
ReportReport
Posted on 13 Jan 2024 12:53:50 by 2

Hello,

I have a Power Automate flow that, for some reason, is triggered twice. I found some other forums posts with similar issue; however, provided solutions. do not apply to my case. Below the details.

 

Environment

 

  • Outlook Web
  • Two calendars in the same mailbox: "Calendar" (main calendar) and "IT Team Vacation Tracker"

When an event "Away" is created in Calendar, it is copied in IT Team Vacation Tracker calendar.

 

Well, Power Automate flow runs twice, and, of course, two equal events are created at the destination calendar: why ? ...and how can handle this behavior (I was thinking to treat it as an array: after of any action in the loop - create, update or delete - save the source appointment id; on next item check if current appointment is equal to previous one. I don't like it because I expect this flow running just one time, but it could be a workaround) ?

 

Screenshot below shows the flow I'm speaking about (please, do not consider the "Case Updated" and "Case Deleted"; I'm still developing this flow):

 

Power Automate Flow.png

 

Here the double triggering:

 

Power Automate double triggering.png

I have the same question (0)
  • creativeopinion Profile Picture
    10,474 Super User 2025 Season 2 on 13 Jan 2024 at 19:53:02
    Re: Calendar event triggered twice

    @lucafabbri365 It seems to be a bug in the trigger. I ran a few tests and this is what I discovered.

    Creating Event without Changing Time

    If you create an event without adjusting the time. The flow only triggers once. 

    creativeopinion_3-1705165753563.png

     

    Creating Event and Adjusting Time

    If you create an event and adjust the time before or after a subject is entered (it really doesn't matter—I tested both ways). It will trigger the flow twice.

     

    The interesting thing is that I thought maybe the second flow trigger would be an update action. Turns out it's a added action. 

    creativeopinion_4-1705165823879.png

    creativeopinion_5-1705165837252.png

    The Event Id for both flow runs are the same. 

    creativeopinion_6-1705165891083.png

     

    Trigger Condition (Optional)

    Instead of using a Condition after your Trigger to check if the Show as is equal to oof. You could use the Trigger Condition. This way your flow will only trigger if this condition matches—preventing any unnecessary flow runs. 

    @equals(triggerOutputs()?['body/showAs'], 'oof')

    creativeopinion_9-1705168403256.png

    Note: The only issue is the flow will not tigger if an item is deleted. However, you might want to consider a different flow to manage deleted items. It will trigger for when an item is Updated.

    Get Events – Vacation Tracker

    To get around the flow triggering twice—you'll need to get the Events from your Vacation Tracker first and run a check on the original Event's ID. This means that upon creating the event, you'll need to add a line of text to output the original Event ID so the flow has a way of checking to see if the event already exists. 

     

    Unfortunately, you won't be able to use the Filter Query on the event body. However, I would recommend reducing the amount of events returned by using a Filter Query. A suggestion would be to filter out events that haven't passed yet. 

     

    creativeopinion_0-1705172488142.png

    Filter Events by ID

    Next, add a Filter Array action. Insert the value dynamic content from the Get events (V4) action into the From field. In the first value field insert Body (capital B, not the one with the lower case b) dynamic content from the Get events (V4) action. Change the operator to contains and insert Id dynamic content from the flow trigger into the second value field.

    creativeopinion_2-1705172636307.png

    creativeopinion_3-1705172705961.png

     

    creativeopinion_1-1705172567634.png

    Get Event Count

    Whenever I use a Filter Array action, I always like to return the count of items returned in a Compose action.

    creativeopinion_4-1705172845899.png

     

    This is helpful when building a. flow and can also be used to troubleshoot your flow. Insert a Compose action. Add an Expression. Use the length() function.

    creativeopinion_5-1705172868583.png

     

    Select the Dynamic content tab and insert the body dynamic content from the Filter Array action into the length() function.

    creativeopinion_6-1705172886277.png

    Condition Check

    Add a Condition check to your flow. Insert the output from the Compose action above (the one storing the number of items returned). Leave the operator to is equal to. Insert a 0 into the second value field. 

     

    This Condition action will check to see if items have returned. If there isn't an existing item (meaning the Filter Array action returned 0 items) add the Create an event action to the YES branch.

    creativeopinion_7-1705172929763.png

    Don't forget to add the Id dynamic content from the flow trigger into the body of the event. This is what the Filter Array action will need to see if there is already an event that has been created. 

     

    Add in any other dynamic content you'd like copied from the flow trigger into this action. I've only filled out the first few fields. Tip: Include the Is all day event? dynamic content—otherwise items marked all day aren't created properly.

     

    Important: Change the Timezone to your local timezone.

    creativeopinion_8-1705172948987.png

    Run a test. Create an item where the status is set to anything but Away. The flow should not trigger. Then create an event where the status is set to Away—the flow should trigger.

     

    creativeopinion_10-1705172304031.png

     

    Update Item

    If there are items, you can add Update Event action to the NO branch. You'll need to use the Event id from the Filter Array action. 

     

    creativeopinion_10-1705173622412.png

    However, when you select the dynamic content—Power Automate will automatically add an Apply to Each action to your flow. That's because the Filter Array action returns an array of items.

    creativeopinion_11-1705173634159.png

    To avoid the Apply to Each action, you'll need to use an expression. You'll need the dynamic content key. If you hover over the dynamic content label you'll see the key between the single quotes. Refer to this section of a YT Tutorial I uploaded on how to get dynamic content from a Filter Array action

    creativeopinion_12-1705173677502.png

    Remove the dynamic content key and pull the Update Event action outside of the Apply to Each action. Insert an expression for the Id. Start with:

    ?[0]['id]

    The [0] will indicate that you want to get the first item in the array. 

    creativeopinion_13-1705173710085.png

    Select the Dynamic content tab and place your cursor at the start of the expression by pressing the up arrow key. Insert the body dynamic content from the Filter Array action. 

    creativeopinion_14-1705173728002.png

    For the rest of the fields in the actions (wherever necessary), insert the dynamic content from the Flow trigger. Ensure you are selecting the dynamic content from the flow trigger and not the Get Events (V4) action.

    creativeopinion_19-1705174078950.png

    Do not forget to include the Id from the flow trigger—just as we did when creating the event. Add in any other dynamic content you'd like copied from the flow trigger into this action. I've only filled out the first few fields. Tip: Include the Is all day event? dynamic content—otherwise items marked all day aren't created properly.

     

    Important: Change the Timezone to your local timezone.

    creativeopinion_22-1705174362450.png

     

    Hope this helps!


    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response! If you're feeling generous— ️  Buy me a coffee: https://www.buymeacoffee.com/acreativeopinion

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on TikTok

     

    Take a look a this YT Tutorial I recently uploaded: 3 Mistakes YOU 🫵 are Making with the Apply to Each Action in your Microsoft Power Automate Flow

    In this video tutorial I’ll go over how to avoid these common mistakes when using the Apply to Each action in a Power Automate flow:

    1️⃣ Looping through a Single Item

    2️⃣ Creating Unnecessary Nested Loops

    3️⃣ Looping through an Unfiltered Array

    At the end of the video I share a few helpful insights when it comes to using the Apply to Each action in your flow.

    I'll also cover:

     How to avoid the Apply to Each action with a single item array

     How to use the item() function to access dynamic content in an array

     How to prevent unnecessary nested Apply to Each action loops

     How to use the Select action

     How to convert an array to a string with the Select action

    How to use the Filter Query field

     How to count the number of items in an array

     How to use a condition control

     How to use the concurrency control

     How to set a top count

     How to use Compose actions for troubleshooting

     

    ---

     

    For more flow troubleshooting tips—check out this YT Tutorial: 5 Power Automate Troubleshooting FAQs and Helpful Tips for Creating Better Flows

    In this tutorial I cover:

     How to troubleshoot a false Condition action result

     How to get dynamic content when it isn’t selectable from the list of dynamic content

     How to troubleshoot an Apply to Each action that isn’t looping through

     How to troubleshoot a skipped Apply to Each action

     How to troubleshoot a Filter Query

     How to use a SharePoint yes/no column in a Filter Query

     How to use Compose actions to troubleshoot a Power Automate flow

    How to troubleshoot multiple emails being sent

     How to troubleshoot multiple Teams messages being sent

     

  • Ellis Karim Profile Picture
    11,209 Super User 2025 Season 2 on 13 Jan 2024 at 19:37:29
    Re: Calendar event triggered twice

    Hi @lucafabbri365 ,

     

    For a possible solution, though using a very different solution to your current flow, see: Synchronize two Outlook calendars with Power Automate (augmentedmind.de).

     

    Alternatively, here is some logic that may help. The flow chart which basically checks Calendar 2 to ensure that the event actually exists before adding, updating or deleting an event.  Outlook Calendar Updating Datavers Appointments table-Copy of Outlook Event updating Outlook.drawio.png

    Hope this helps.


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as ☑️ Solved.
    If you like my response, please give it a Thumbs Up.
    My Blog Site

     

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading started
Loading complete