This isn't just a PowerApps question, I just happen to be doing the query in PowerApps so I'm here asking for help.
I have an existing filter condition for a gallery that is working. I'd like to add an additional condition and can't figure out the logic on my own. I know what I want to do, I just can't write the code.
Current Filter:
Filter(
'SPIFF - Requests',
(galFilter.Selected.Value = "All" || Status.Value = galFilter.Selected.Value) &&
Approval_Level = LookUp('SPIFF - Approvers', User().Email = Approver.Email, Approve_Level)
)
What I want/need to add is an additional condition.
I want to check for records in 'SPIFF - Approvals' related to the Items returned for the current user. In other words, only show Requests if the users approval level matches the approval level as above AND there are 0 records in 'SPIFF - Approvals' for the request created by the current user. The approvals table holds the Request ID in a field name PositionID.
Here is my attempt which I think is pretty close but is returning no records and I can't figure out how to correct the filter statement.
Filter(
'SPIFF - Requests',
(galFilter.Selected.Value = "All" || Status.Value = galFilter.Selected.Value) &&
Approval_Level = LookUp('SPIFF - Approvers', User().Email = Approver.Email, Approve_Level) &&
(CountIf('SPIFF - Approvals', Approver.Email = User().Email && Status.Value = "Approved") = 0)
)
Thank you in advance to the good samaritan who comes to my rescue.