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 / Planner - Create a Tas...
Power Automate
Answered

Planner - Create a Task - I need help writing an expression for the Start Date Time field to be the first business day of the month

(0) ShareShare
ReportReport
Posted on by 137

I have a recurrence flow that kicks off on the first day of each month at 7AM EST.  I want this flow to create a new task in planner.  I want the start date to equal the first business day of the month.  This should mean the task always gets created on the 1st but the start date is either 1st, 2nd, or 3rd.  As an example, the start date for the MAY 2021 monthly task should be May 3, 2021 although the task itself gets created on May 1, 2021.  We can ignore holidays.  What should this expression look like?  Thanks for any help!

 

Scott0044_0-1610030884698.png

 

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

    Hi @Scott0044,

     

    I create a flow that checks whether the first day of a month is Saturday or Sunday by using conditions.

     

    If it’s Saturday or Sunday, then the start date of the task is the next Monday.

    If not, then the start date is the day the task is created.

     

    You only need two kinds of functions: dayOfWeek, addDays. 

    ps. In the ‘dayOfWeek’ function, the return value 6 means Saturday, 0 means Sunday.

     

    Go to the two links to see the functions above:

    https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#dayOfWeek 

    https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#addDays 

     

    The functions used in the picture below:

     

    dayOfWeek(outputs('Create_a_task')?['body/createdDateTime'])

    addDays(outputs('Create_a_task')?['body/createdDateTime'],2)

     

    1.8-2.PNG

     

    The new functions used in the picture below:

     

    addDays(outputs('Create_a_task')?['body/createdDateTime'],1)

     

    1.8-3.PNG

     

    Best Regards,
    Community Support Team _ Kira Xie
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Scott0044 Profile Picture
    137 on at

    Exactly what I needed, thanks!

     

    As a heads up to anyone else that finds this thread, I had parallel tasks getting created in planner.  So I renamed the 'Create a task' to the category.  example: 'Create a PENSION task'.  This impacts the condition code:

     

    Instead of:

    dayOfWeek(outputs('Create_a_task')?['body/createdDateTime'])

    I edited as:

    dayOfWeek(outputs('Create_a_PENSION_task')?['body/createdDateTime'])

     

    And for start date time I used:

     

    #if not a weekend:
    utcNow()
    
    #if sunday
    addDays(utcNow(), 1)
    
    #if saturday
    addDays(utcNow(), 1)

     

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
Haque Profile Picture

Haque 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard