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 Email arrives,...
Power Automate
Unanswered

When an Email arrives, create a calendar entry accounting for holidays and business days/time

(0) ShareShare
ReportReport
Posted on by 2
Hello all,
 
I am new to Power automate however, I would like to create a flow that whenever a new email arrives, it creates an outlook calendar entry based on the date of the first email in the chain of that specific email. It also needs to account for business days and holidays. So far, I have created a flow that creates a calendar entry that accounts for business days and holidays, however, it is only based on the date of the newest email in the chain, not the oldest. Also, it doesn't account for business hours (8am to 5pm). Please see the flow below:
 
Compose 'Date': utcNow()
 
Compose 'Dates': From: Range (0,365)
                 Date: formatDateTime(addDays(outputs('Date'), item()), 'yyyy-MM-dd')
                 Day:  dayOfWeek(addDays(outputs('Date'),item()))
 
Filter Array 'ExcludeHolidays': From: Value from 'Filter out Saturdays and Sundays'
                                Left: Output from 'Holiday Days'
                                Right: item()['Date']
 
Compose 'Target Date': body('ExcludeHolidays')[outputs('Days_to_Add')]['date']
 
 
I am new to the coding language so any visuals or code that I can copy/paste would be great, thanks!
PowerAutomatePNG.png
Categories:
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    679 on at
    Hi,

    What is the actual business requirement you try to solve here? I'm not able to understand what you want to achieve. When an email arrives, you want to look for older messages in that thread and based on the oldest email you want to create a calendar item in the past? In case that date was in the weekend or on a bank holiday, what date do you then want to use for that email?
    In case the first email in the chain arrives, then you might already create the calendar item. Why are you then searching for the oldest email and try to insert a duplicate calendar item?
  • JL-14062200-0 Profile Picture
    2 on at
    For the business, every email request sent to a specific email address is required to be due 10 business days from the date of receipt. This initial email can be sent to another department before ours, therefore we would get it, say, 3 business days from the date of initial receipt. I have put an example below:
     
    Initial email (Rec'd June 8, 2026) -> sent to budgeting (June 9, 2026) -> sent to my department (June 11, 2026).
     
    (10 Business days from June 8, 2026, is June 23, 2026, if we account for a local holiday on the 19th)
     
    I would like it, if possible, that when the email chain arrives to my department, a calendar entry is made for June 23, 2026, and not June 26, 2026, which it would have normally done according to the trigger "When an email arrives."

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 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard