cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Julien2
Post Prodigy
Post Prodigy

Leave request Flow

Hello everyone !

I have 2 lists in SharePoint:
-Leave Request: Contain 3 columns (Title, StartDate, EndDate).
-Employee Leave Request Dashboard: Contain 4 columns (Title,EmployeeName,Amount of Annual Leave, Balance of Annual).


I want to create one flow for both lists:

1. For Leave request:

  -When the item is created in SharePoint.
  -I want to add conditons to check first if the employee request a vacation more than 3 days to send an approval to Manager and HR.
  -If the leave request of the employee is less than 3 days i want to send only the email for the HR without sending to Manager.

 

2. For Employee Leave Request Dashboard:
(Note: Total of Annual Leaves is 15 days by default).
 -Suppose i am the manager or HR and i want to approve the leave request for this employee that he request a vacation for 3 days.  If someone of them approved the Leave request i want to update the Balance of Annual column to show the total for remaining days for his vacation.
-I should subtract the balance of annual (-) the amount of annual. (So If he requested 3 days and the leave request is approved the column will be (15-3) = 12).
-If its rejected the balance will remain the same. (15 days).

 

So any suggestion how to build this flow and what are the expressions i have to use to calculate the dates ? (I am using the dates based on the calendar)(SAME YEAR).

 

Thank you!!

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @Julien2,

 

1. There is no date dif function in Flow, so, the only way to compare two dates whether having three days dif, you can use the addDays() function, to add start date 3 days, then compare it whether great than end date, if it is, the vacation is not more than 3days.

2. If you want to caculate two dates to get the leave days, as a workaround, you can use the dayOfYear() function, to get two dates dif, for example:Annotation 2019-10-18 101208.png

And the date is a vacation, so it may need to add one day after getting the dif.

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

View solution in original post

3 REPLIES 3
v-litu-msft
Community Support
Community Support

Hi @Julien2,

 

1. There is no date dif function in Flow, so, the only way to compare two dates whether having three days dif, you can use the addDays() function, to add start date 3 days, then compare it whether great than end date, if it is, the vacation is not more than 3days.

2. If you want to caculate two dates to get the leave days, as a workaround, you can use the dayOfYear() function, to get two dates dif, for example:Annotation 2019-10-18 101208.png

And the date is a vacation, so it may need to add one day after getting the dif.

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

View solution in original post

v-litu-msft
Community Support
Community Support

Hi @Julien2,

 

Has your problem been solved?
If your problem has been solved, You could go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

Best Regards,
Community Support Team _ Lin Tu

Sorry for late reply. Yes it's solved thank you!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,652)