cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (11,465)