Hi folks.
I built a vacation request APP and I am having issues on substracting the total vacations left field from the amount of days requested adn sum the total of vacation day to the new days requested (Both fields are numbers in sharepoint).
Here are the sharepoint lists:
Employee: It has all the fields for total of days of vacations taken, total of days of vacation left:
Leave Request: it stores leave date, return date, total days requested:
Once the requequest its submitted on powerapps, the approval status are changing and when its finally approved I need to do folowing changes on the Employee list:
1. Sum the total days requested to the DateVacTaken
2. Substract the total days requested to the DateVacLeft
From this point I use a flow in power automate to do the calculations but everything is giving errors
Any ideas on how to do these two math operation using the sharepoint columns.
Thanks
Jose Luis
@Pepelucho78, I dont think you need to have the apply to each function in your case. Here is the step by step process to update the Employees DaysVacTaken and DaysVacLeft.
1. Flow Triggering : On Update Item in Leave Request (SP List) -> In advanced option check the value of "Status eq Approved"
2. Get Item from SharePoint list "Employees" based on the Employee ID in the Leave Request update item.
3. Compose NewDaysVacLeft-> DaysVacTaken - DaysRequested
4. Compose NewDaysVacTaken -> DaysVacTaken + DaysRequested
5. Update Item in SharePoint Employees list :
Set DaysVacTaken = NewDaysVacTaken
Set DaysVacLeft = NewDaysVacLeft
Now, you are good to go. Hope you have understood the steps involved.
Please accept this as Solution, If it is helpful for you.
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional