web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter a gallery from ...
Power Apps
Answered

Filter a gallery from the values of a column in a different data source

(1) ShareShare
ReportReport
Posted on by 2
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)
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    154,797 Most Valuable Professional on at
    Try this format
    With(
       {_UserName: Office365Users.MyProfile().DisplayName},
       Switch(
          Dropdown_CurrentView.Selected.Value,
          "Packages Pending My Approval",
          Filter(
             AddColumns(
                Packages_List,
                CurSeq,   
                LookUp(
                   Workflows_List, 
                   ID = 'Workflow ID', 
                   'Current Sequence'.DisplayName
                )
             ),
             CurSeq = _UserName         
          ),
          "All Packages in My Queue",
          Filter(
             Packages_List, 
             'Sequence 1'.DisplayName = _UserName ||
             'Sequence 2'.DisplayName = _UserName ||
             'Sequence 3'.DisplayName = _UserName
          ),
          "Packages Where I'm a POC",
          Filter(
             Packages_List, 
             'Action Officer' = _UserName
          )
       )
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard