I have a SharePoint list with this structure:
User | PTO Start | PTO End |
User1 | 03/11/2024 | 03/15/2024 |
User2 | 03/15/2024 | 03/15/2024 |
User3 | 4/21/2024 | 4/25/2024 |
My current flow:
I have filtered the SharePoint list to only show dates between now and (now + 30 days) to filter out past PTOs.
On apply to each, I would like to extract the dates between a user's PTO Start and End dates.
After extracting, I need to check if the range between PTO Start and End dates is equal to today. If so, I would like to put in on a table and send it via email.
Problem: How do I extract the dates between PTO Start and PTO end?
Expected Output: Send an email where it lists the users who are on PTO today.
You could try below filter query to check in between dates:
PTO_x0020_Start_x0020_Date eq '@{formatDatetime(utcNow('yyyy-MM-dd'))}' or PTO_x0020_End_x0020_Date eq '@{formatDatetime(utcNow('yyyy-MM-dd'))}' or (PTO_x0020_Start_x0020_Date lt '@{formatDatetime(utcNow('yyyy-MM-dd'))}' and PTO_x0020_End_x0020_Date gt '@{formatDatetime(utcNow('yyyy-MM-dd'))}')
If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.
If I understand correctly, this would only check if the PTO date matches the start/end dates. I need to know the if it's also in between the dates and return it.
Hi @Redux014
You could use the below filter query to check if PTO start or end date is the current date:
PTO_x0020_Start_x0020_Date eq '@{formatDatetime(utcNow('yyyy-MM-dd'))}' or PTO_x0020_End_x0020_Date eq '@{formatDatetime(utcNow('yyyy-MM-dd'))}'
Pls copy & paste the filter query directly in the flow.
If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2