I'm developing a power apps application that will act as a document workflow and routing application. I have two data sources in my app, two SharePoint (SPO) lists:
"Packages_List" and "Workflows_List". When an end user creates a package (by creating an item in 'Packages_List'), they need to also create a "route" where a user can be assigned to perform some action on the "package". The value of each user is stored in the columns in 'Workflows_List' under each 'Sequence 1', 'Sequence 2', etc. I have one screen and one gallery in that screen displaying "Packages_List". I need the following filters applied to this gallery:
1) Filter the items in the gallery ('Packages_List' is the data source) where the current logged in user is equal to the value of the column 'Current Sequence' in 'Workflows_List'. The 'Workflow ID' column in 'Packages_List' will match the 'ID' column in 'Workflows_List', tying that "route" to that specific package. I only want the end user to see the package details in this filtered view when they are equal to the 'Current Sequence'.
2) Filter the items in the gallery to show all of the packages for the logged-in user where they are equal to any value in any of the 'Sequence' columns in 'Workflows_List'. This filter will show all packages where the current logged-in user has any packages upcoming or completed.
3) Filter the items in the gallery where the current logged-in user is equal to the column 'POC' in 'Packages_List'. The 'POC' column can have multiple values (person column).
SPO List columns:
Workflows_List
ID (num), Title (text), Current Sequence (person), Sequence 1 (person), Sequence 2 (person), Sequence 3 (person), Package ID (num)
Packages_List
ID (num), title (text), type (choice), org (choice), suspense (date), action officer (person), POC (person), Workflow ID (num)
'Items' property of the gallery:
Switch(
Dropdown_CurrentView.Selected.Value,
"Packages Pending My Approval",
Filter(Packages_List, Office365Users.MyProfile().DisplayName = LookUp(Workflows_List, ID = ThisItem.'Workflow ID', 'Current Sequence')),
"All Packages in My Queue",
Filter(Packages_List, Office365Users.MyProfile().DisplayName = LookUp(Workflows_List, ID = ThisItem.'Workflow ID', )),
"Packages Where I'm a POC",
Filter(Packages_List, 'Action Officer' = Office365Users.MyProfile().DisplayName)