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 / PTO request system in ...
Power Automate
Unanswered

PTO request system in Microsoft Lists that factors in an employee’s work schedule

(0) ShareShare
ReportReport
Posted on by

Hi,

I am setting up a PTO (Paid Time Off) request system in Microsoft Lists that factors in an employee’s work schedule which then populates to a secondary list in which I use the calendar view.

Origins is a MS Form with a few Automations after the form is submitted is goes to list #1 for manual approval. see below

User's image

After approval the entry will go to another list in which I use the Calendar view.

So far so good. I would like to incorporate the work schedule ex. staff #1 works Tuesday - Saturday. For a consistent PTO request staff #1 can request Tuesday-Tuesday off as a single request due to consecutive days. I would like the process to only add the work days that are within the staff work schedule.

I made another MS List with staff work schedule.

User's image

This is where I get stuck.

I've tried various flows and cannot figure it out.

Help is much appreciated. Thank you in advance.

I have the same question (0)
  • Expiscornovus Profile Picture
    33,891 Most Valuable Professional on at
     
    My suggestion would be to check the work days when you are receiving the input from the Microsoft Forms.
     
    In other words, in that flow you could retrieve the Sun-Thu working days and see if the Start and End Date days match those working days. If not, you can reject/deny the request.
     
    Below is an example how you could retrieve the Work Days via a Get Items and convert it dayOfWeek WorkDays array.
     
    For your request you could do the same (PTORequestDatesArray) and then compare the two arrays and return the exceptions. If it contains exceptions somebody is requesting something for a non-working day. Damien Bird has a nice blog on how to filter for exception between two arrays.
     
    Working days array part
     
    1. Split to get the Sun and Thu separately in an array
    split(first(outputs('Get_items')?['body/value'])['WorkDays'], '-')
    2. Match it against an array of working days
    json('{"Sun":0,"Mon":1,"Tue":2,"Wed":3,"Thu":4,"Fri":5,"Sat":6}')[item()]
    3. Use a range to get all individual day numbers between the start and end date
    range(first(body('Select')),last(body('Select')))



    Request Days array part
     
    1. Get datedifference between Start Date and End Date fields of form.
     
    range(0,int(first(split(dateDifference(outputs('Get_response_details')?['body/r9ebd7d23f21247939ea37e09bfc811c1'],outputs('Get_response_details')?['body/r6e36858f8f4a4426a6a160c5fd54d5e1']), '.'))))
    2. Append days to an array
    dayOfWeek(addDays(outputs('Get_response_details')?['body/r9ebd7d23f21247939ea37e09bfc811c1'], item()))
    3. Append End Date dayofweek value to array (outside of loop)
     
    dayOfWeek(outputs('Get_response_details')?['body/r6e36858f8f4a4426a6a160c5fd54d5e1'])




     
    Happy to help out 😁

    I share more #PowerAutomate and #SharePointOnline content on my Blog, LinkedIn, Bluesky profile or Youtube Channel

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