Hi, I have 3 Sharepoint lists that are related to each other; 'Leave Request', 'Employee' and 'Approvers'. The employees apply for leaves in the 'Leave Request' list, and their names are added before that in the 'Employee' list. The employees' approvers, approval type and level are determined in the 'Approvers' list. The lists are related by from the 'Leave Request' list contains the Requester name, and it matches the name in the 'Employee' list where it has a column, Approval Type that will match in the 'Approvers' list to determine who is/are the approver(s) for that employee. All the employees and approvers columns are people columns.


I've set the item level permission in the 'Leave Request' list so that only the requester and his approvers can view the item. The approval for the leave request is approved or rejected on the item in the 'Leave Request' list.

My problem is how to check which level the current user logged in is and how to make the approval multi-level. The approval is multiple and hierarchical. If the Level 1 Approver hasn't approved the leave request then it won't go through the Level 2 Approver or Level 3 Approver and so on. When an item is created in the 'Leave Request' list, the Status will be pending and the Level1 Approver will need to click Approve button and then it will patch the Approval Status to indicate that Level 1 Approver has approved, pending Level 2 Approver and so on. Then Level 2 approver approves the leave request, then it will patch the Approval Status as Level 1 has approved, Level 2 has approved, if there is another level then it will pending the level.
//App.OnStart
Set(IsApprover, LookUp(Approvers, Approver.Email = CurrentUser).Approver.Email);
Set(ApproverByType,LookUp(Approvers,CurrentUser=IsApprover).Title);
Set(ApproverLevel, LookUp(Approvers, ApproverByType = CurrentUser).Level);
Set(checkApprovers,Filter(Approvers, Approver.Email = CurrentUser));
I set the variables and use them on Button Approver visible property -> If(CurrentUser=IsApprover) to check the approver. But it doesn't really work out the way I want and I'm not sure how to achieve this. Can someone please help me?
Thank you.