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 : M84yw2MeZ3HwVXWBD1/4C0
Power Automate - Building Flows
Answered

Get certain day of month

Like (0) ShareShare
ReportReport
Posted on 23 Jan 2020 17:00:53 by 303

Hello everyone,

 

I'm building a Power Automate that needs to run on the 1st and 15th of the month and needs to get list items that fall between certain dates: 

 

First of month: day 16 of previous month - end of previous month

15th of month - 1st day of current month through 15th of current month

 

How can I do this?

  • JMAFO Profile Picture
    303 on 24 Jan 2020 at 15:55:43
    Re: Get certain day of month

    I was on the cusp of figuring this part out and you solved the riddle. Your wizardry is truly unmatched! 

     

    Thanks again! 

  • LeeHarris Profile Picture
    1,026 on 24 Jan 2020 at 15:53:04
    Re: Get certain day of month

    Hi @JMAFO 

    Good to hear you got it working 😃👍

     

    Without knowing the exact field names and syntax, it would probably be a filter along the lines of..

     

    Get Items where...

    (VacationStartDate greater than TimePeriodStartDate AND VacationStartDate less than TimePeriodEndDate ) OR (VacationEndDate greater than TimePeriodStartDate AND VacationEndDate less than TimePeriodEndDate)

     

  • JMAFO Profile Picture
    303 on 24 Jan 2020 at 15:32:49
    Re: Get certain day of month

    This worked beautifully. Thank you!

     

    So I'm trying to generate a report, how would I make sure that both vacations starting in the time period and vacations ending in the time period are grabbed by the Get Items action?

  • LeeHarris Profile Picture
    1,026 on 24 Jan 2020 at 09:28:18
    Re: Get certain day of month

    Hi @Stuznet 

    If you would like to exclude weekends, you can make use of the Flow Expression dayOfWeek(). Pass this a DateTime value and it will return an integer where Sunday is 0, Monday is 1 etc. You can use this in a condition action to perform certain actions on weekends.

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

     

  • v-alzhan-msft Profile Picture
    on 24 Jan 2020 at 06:10:33
    Re: Get certain day of month

    Hi @JMAFO ,

     

    Please take a try with @LeeHarris 's solution and let me know if you have any problem.

     

    Best regards,

    Alice       

     

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

  • Stuznet Profile Picture
    71 on 24 Jan 2020 at 01:24:12
    Re: Get certain day of month

    This is great but how do you exclude weekends? 

  • PowerBack19 Profile Picture
    679 on 23 Jan 2020 at 17:22:50
    Re: Get certain day of month

    @JMAFO - You can create a trigger that is "Scheduled". The scheduled trigger will allow you to choose when the flow would start.

     

    Here is more info about scheduled triggers: https://docs.microsoft.com/en-us/power-automate/run-scheduled-tasks

  • Verified answer
    LeeHarris Profile Picture
    1,026 on 23 Jan 2020 at 17:21:33
    Re: Get certain day of month

    Hi @JMAFO 

    You will need to create a Flow with a Recurrence trigger that fires every day. The first action in your flow should be a Switch case where the item you are checking is the following Flow Expression.

     

    dayOfMonth(utcNow())
     
    You then need to add a case branch for the value 1 (1st day of month) and another for the value 15 (15th day of month). You should also have a default case which we will leave blank.
     
    image.png
     
    In the first case (1st of month) add the action to get list items. You can use the following Flow Expressions for the dates you need to check.
     

    day 16 of previous month

    addDays(startOfMonth(addDays(startOfMonth(utcNow()),-1)),16)

     

    end of previous month

    addDays(startOfMonth(utcNow()),-1)

     

    Likewise for the case for the 15th day of the month, use the following Flow Expressions.
     
    1st day of current month
    startOfMonth(utcNow())
     
    15th of current month

    addDays(startOfMonth(utcNow()),15)

     

    Hope that helps, if you get stuck using any of these expressions please post some screenshots of your errors.

     

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

Telen Wang – Community Spotlight

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

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 complete