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?
I was on the cusp of figuring this part out and you solved the riddle. Your wizardry is truly unmatched!
Thanks again!
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)
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?
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.
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.
This is great but how do you exclude weekends?
@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
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.
day 16 of previous month
addDays(startOfMonth(addDays(startOfMonth(utcNow()),-1)),16)
end of previous month
addDays(startOfMonth(utcNow()),-1)
addDays(startOfMonth(utcNow()),15)
Hope that helps, if you get stuck using any of these expressions please post some screenshots of your errors.
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2