Hello PowerApp community,
Hoping someone can give me some direction. For some context I have data containing employee name, location, observation date, and observer name. This dataset has almost 14K rows with data from the past 2-3 years. The app is to record employee's tasks and there can be multiple entries for each employee name over the years. Since that is a lot of data to scroll through we want users to Filter and sort based on these conditions from a popup window within the screen:
1. if they select employee name but not location. Filter & Sort (with most recent on top) gallery with all the data regarding that employee name
2. if they select location, but not employee name. Filter & Sort (with most recent on top) gallery with all the data for that location.
3. if neither are selected just sort the gallery with all the data with the most recent entries at the top of the screen.
I created this app in my test environment that points to a SharePoint list of my own. When I moved this app an connected it to another SharePoint site (used by the business team) my code broke. I've created and re-created this list several times!!! I think something is askew with the site itself it breaks my code every time. I was using Observation_date26 since I wanted to sort and filter based on date. But that kept breaking, so I switched to "ID" from the SharePoint list. I can only sort my gallery view on ID but the filtering will not work.
Code:
If(Not(IsBlank(ComboBox_Employee.Selected.Result)&&IsBlank(ComboBox_Location.Selected.Result)),Sort(Filter(NewObservationsDATA,Employee_Name=ComboBox_Employee.Selected.Result),ID,Descending),IsBlank(ComboBox_Employee.Selected.Result)&&Not(IsBlank(ComboBox_Location.Selected.Result)),Sort((Filter(NewObservationsDATA,Location=ComboBox_Location.Selected.Result)),ID,Descending),Not(IsBlank(ComboBox_Location.Selected.Result))&&Not(IsBlank(ComboBox_Employee.Selected.Result)),Sort(Filter(NewObservationsDATA,Location=ComboBox_Location.Selected.Result,Employee_Name=ComboBox_Employee.Selected.Result),ID,Descending),Sort(NewObservationsDATA,ID,Descending))
I need to ideally filter and sort through all the data but if not I can restrict the data to everything from the start of 01/01/2022.