PowerApps - Multiple Filtering Conditions
In the PowerApps on Load, i had a requirement to show the screens based on multiple conditions as below,
- Is User Having Admin Permissions (These are checking from a List in SharePoint)
- Check if Item is Status is Pending
- Current User Location is Same Location as the Item (User Location details is in SharePoint List)
- Current User LastWorking Day is Greater than Project Item Completion Date
For the details on the Screen - OnVisible property, I updated following code to get User details (IsAdmin, Location and Last Working Date)
Set(varCurrentLoggedInUser,User());
Set(
varCurrentLoggedInUserDetails,
LookUp(
'User Details',
User.Email=varCurrentLoggedInUser.Email
)
);
Once we get the details, I have added following logic on click on the Gallery Item,
If(varCurrentLoggedInUserDetails.Admin,
If(ThisItem.Status="Pending" &&
ThisItem.Location=varCurrentLoggedInUserDetails.Location &&
ThisItem.ClosingDate<=varCurrentLoggedInUserDetails.LastWorkingDate,
Navigate(EditScreen)
),
Navigate(ViewScreen))
Comments