Hi, I have this 1 list for admin to add new leave types.
Right now I'm doing if an item's status is 'Approved' in the Leave Request list, it will then subtract the leave balance for that particular employee and leave type. For example, ABC applies for a Sick Leave for 2 days and it has been approved by his approvers. ABC's original leave balance for Sick Leave is 4 days so when his application is approved, his new leave balance is 2 days. It creates issues for me to update ABC's leave balance as I can't use the switch to determine which leave type ABC has applied because the admin could be adding new ones. It also creates issues to subtract for each leave type.
How to solve these issues?
This is my previous method to deduct the leave balance and it uses a switch for the leave type.
Thank you.
@syhrh Use filter query in Get items from leave types for Leave types. When someone apply for leave, you will have leave types. Use this from trigger to get items for leave types filter and the same in Leave balance.
Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.
This is what I currently have done but it doesn't work.
I don't know how to calculate for those columns based on the leave type because previously I use a switch so it will need to fill in 2 columns only for the calculations.
This is my previous calculation in another flow.
sub(items('Apply_to_each')?['EmergencyLeave'], triggerOutputs()?['body/Total_x0020_Days_x0020_Applied'])
add(triggerOutputs()?['body/Total_x0020_Days_x0020_Applied'],items('Apply_to_each')?['EmergencyLeaveUsed'])
How to fill in the formula for all columns (the leave type) but it will only update based on the leave type modified/created by the user in the first place?
@syhrh Use get items for leave types and use filter query so that if it is new leave type get items will return result.
Pls share complete flow.
Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.