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 / Flow to place holds be...
Power Automate
Suggested Answer

Flow to place holds between all pre-existing meetings on Outlook Calendar?

(0) ShareShare
ReportReport
Posted on by
Hi team, 
 
I'm seeking to automate a flow that scans all weekdays on a calendar, and creates events ("tentative" holds) in all of the gaps between any pre-existing meetings between the hours of 8:30am and 5:30pm EST. 
 
I feel clear about the mission but keep getting tripped up as I attempt to build this flow. Can anybody help? 
 
 
I have the same question (0)
  • Suggested answer
    sannavajjala87 Profile Picture
    388 Super User 2026 Season 1 on at
    Hi,
    Yes, this is possible, but I would build it in small steps because the tricky part is not creating the events , it is calculating the gaps correctly.
    A good approach would be:
    1. Use a Recurrence trigger to run the flow daily or weekly.
    2. Generate the weekday dates you want to check.
    3. For each weekday, define your working window:
      • Start: 8:30 AM EST
      • End: 5:30 PM EST
    4. Use Get calendar view of events to get existing meetings for that day.
    5. Sort the events by start time.
    6. Compare each meeting’s start time with the previous meeting’s end time.
    7. If there is a gap, create a new Outlook event marked as Tentative.
    8. After the last meeting, also check for a gap until 5:30 PM.
    Example logic:
    Workday start = 8:30 AM
    Previous end = 8:30 AM

    For each existing meeting ordered by start time:
      If meeting start > previous end:
         Create tentative hold from previous end to meeting start

      Set previous end = max(previous end, meeting end)

    After all meetings:
      If previous end < 5:30 PM:
         Create tentative hold from previous end to 5:30 PM
    A few things to watch for:
    • Use Get calendar view of events, not just “Get events,” because you need a start/end window.
    • Exclude all-day events if they should not block the calendar.
    • Be careful with time zones. Store the working hours in Eastern time and convert as needed.
    • Add a unique subject like “Tentative Hold - Auto Created” so the flow can identify and avoid duplicating holds on future runs.
    • Before creating a hold, check whether an auto-created hold already exists in that time slot.
    I would first test this for one day only, then expand it to all weekdays once the gap logic is working.
     
  • Suggested answer
    Assisted by AI
    Sam_Fawzi Profile Picture
    915 Super User 2026 Season 1 on at
     
    The suggested answer has the right shape, but it skips the two things that actually make this flow fail in practice: Apply to each concurrency and time-zone handling. Here's a concrete build that fills those gaps.
    The two gotchas to get right first

    Concurrency must be 1. The whole approach relies on a running "previous end" variable updated meeting-by-meeting. Apply to each runs in parallel by default, which scrambles that. In the Apply to each → Settings, turn on Concurrency Control and set degree to 1 (sequential). Without this, your gaps will be wrong on any day with more than one meeting.
    Work in UTC, think in Eastern. The Outlook connector wants UTC for the calendar-view window, but your business rule is 8:30–17:30 Eastern. Build the window like this:
    windowStartUtc = convertToUtc(
      concat(formatDateTime(convertFromUtc(utcNow(),'Eastern Standard Time'),'yyyy-MM-dd'),'T08:30:00'),
      'Eastern Standard Time')
    windowEndUtc = convertToUtc(
      concat(formatDateTime(convertFromUtc(utcNow(),'Eastern Standard Time'),'yyyy-MM-dd'),'T17:30:00'),
      'Eastern Standard Time')

    Eastern Standard Time (the Windows zone id) auto-handles EST/EDT, so you don't hardcode the offset.
     
    The build
    1. Recurrence trigger — set it to run on weekdays only (the recurrence action lets you pick Mon–Fri), so you don't need separate weekday-filtering logic.
    2. Initialize variables: windowStartUtc, windowEndUtc (as above), and varPrevEnd (String) initialized to windowStartUtc.
    3. Get calendar view of events — use this, not Get events, because it expands recurring series into individual instances inside your window. Start Time = windowStartUtc, End Time = windowEndUtc.
    4. Filter array to drop all-day events: keep items where isAllDay is equal to false. Calendar view normally returns events ordered by start time; if you want to be safe, this is also where an Office Script sort would slot in, but in practice the view comes back start-ordered.
    5. Apply to each over the filtered events, concurrency = 1:
    Condition — gap exists?
     
         ticks(items('Apply_to_each')?['start']?['dateTime']) > ticks(variables('varPrevEnd'))
     
    • If yes → Create event (V4): Start = varPrevEnd, End = current meeting's start/dateTime, Show as = Tentative, Subject = Tentative Hold - Auto Created. Set time zone on the action to UTC since those values are UTC.
    • Then set varPrevEnd to the later of the two ends (handles overlapping meetings):
         
    if(greater(ticks(items('Apply_to_each')?['end']?['dateTime']), ticks(variables('varPrevEnd'))),
            items('Apply_to_each')?['end']?['dateTime'],
            variables('varPrevEnd'))
     Referencing the variable inside its own Set is fine — it reads then writes.
     
    6. After the loop — trailing gap to end of day:
    • Condition: ticks(variables('windowEndUtc')) > ticks(variables('varPrevEnd'))
    • If yes → Create event from varPrevEnd to windowEndUtc, Tentative.
    Avoiding duplicate holds on re-runs
    Cleanest pattern: at the top of the flow (right after step 3's window is known), run a second Get calendar view of events → Filter where subject equals Tentative Hold - Auto Created → Apply to each → Delete event. Then build fresh. That makes the flow idempotent — every run wipes its own prior holds and recomputes, so calendar changes are always reflected and you never stack duplicates.

    (If you don't delete first, the previously-created holds will be returned by the main calendar view as existing events, which actually suppresses duplicates naturally — but it also means a deleted meeting won't free up its slot, so the delete-and-rebuild approach is safer.)

    One thing worth deciding before you build: do you want one hold spanning each entire gap, or back-to-back 30-minute holds within each gap? The logic above creates one block per gap; if you want fixed slots, you'd add an inner loop that steps through the gap in 30-minute increments. 

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 481

#2
11manish Profile Picture

11manish 278

#3
David_MA Profile Picture

David_MA 276 Super User 2026 Season 1

Last 30 days Overall leaderboard