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

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Gallery to show only items in the list where a unique number is matched from another list

(0) ShareShare
ReportReport
Posted on by 269
Hi All, 

So this is probably a really easy one and its possibly one i knew how to work out a few years back, however since creating my app (That we use all the time! 🤲) i haven't really done any work in powerapps since and have forgotten some key elements. - I'm now trying to add a new feature to the app and i've come unstuck with creating a gallery! 😩

I have a list called "MaterialList" (which has less than 2000 items). all the lines in this material list have have a column called "BelRef" which has unique number for each row. Other columns include "Product" and "CostEa" and many more,
 
I have created a new list called "KitList".  This list only had a column called "KitRef" and a Column Called "Qty" and a Column Called "BelRef"
 
I have created a screen in PowerApps where users can add to the Kit list by searching items from the MaterialList, inserting a QTY and then clicking a button to add them to add a new record to the KitList.

For reference the KitList would Look something like the below;
 
KitRef Qty BelRef
Kit-1 2 245
Kit-1 3 276
Kit-1 1 6
Kit-1 17 42
Kit-1 3 56
 
I am then wanting to create a gallery where the datasource, i assume would be "MaterialList", however rather than showing all 1,800 rows (or however many there may be), it only shows the items from the MaterialList where BelRef is shown in the Kit list.  Ie.  from the table above it would return 5 rows. - At this point though i am wanting to be able to show the "Product" and "CostEa" column,

I have tried filtering the datasource and cant seem to get that to work and i have also tried to filter the Text Inputs within the gallery and i cant get that to work either.

I cant work out if there needs to be a ForAll in there somewhere?

Any help would be much appreciated so that i can jump back on the powerapps bandwagon!  
  
I have the same question (0)
  • Chriddle Profile Picture
    8,391 Super User 2025 Season 2 on at
    Gallery to show only items in the list where a unique number is matched from another list
    ClearCollect(
        MaterialList,
        {
            BelRef: "000",
            Product: "P0",
            CostEa: 123
        },
        {
            BelRef: "001",
            Product: "P0",
            CostEa: 3
        },
        {
            BelRef: "002",
            Product: "P0",
            CostEa: 50
        },
        {
            BelRef: "003",
            Product: "P0",
            CostEa: 10
        }
    );
    ClearCollect(
        KitList,
        {
            KitRef: "Kit-1",
            Qy: 2,
            BelRef: "000"
        },
        {
            KitRef: "Kit-2",
            Qy: 2,
            BelRef: "002"
        },
        {
            KitRef: "Kit-3",
            Qy: 2,
            BelRef: "003"
        }
    );
    Set(
        FilteredList,
        Filter(
            MaterialList As MatList,
            Not(
                IsBlank(
                    LookUp(
                        KitList,
                        BelRef = MatList.BelRef
                    )
                )
            )
        )
    );
  • Power Platform 1919 Profile Picture
    1,660 on at
    Gallery to show only items in the list where a unique number is matched from another list
    Hi ,
    Adding to  response, 
    You can try this power fx, 
    ClearCollect(
        MaterialList,
        {BelRef: "000",Product: "P0",CostEa: 123},
        {BelRef: "001",Product: "P0",CostEa: 3},
        {BelRef: "002",Product: "P0",CostEa: 50},
        {BelRef: "003",Product: "P0",CostEa: 10}
    );
    ClearCollect(
        KitList,
        {KitRef: "Kit-1",Qy: 2,BelRef: "000"},
        {KitRef: "Kit-2",Qy: 2,BelRef: "002"},
        {KitRef: "Kit-3",Qy: 2,BelRef: "003"}
    );
    ClearCollect(
        filtered,
        Filter(
            MaterialList,
            ThisRecord.BelRef in KitList.BelRef
        )
    );
    ClearCollect(
        filtered_v2,
        Filter(
            MaterialList As _M,
            LookUp(KitList As _K,_M.BelRef = _K.BelRef).BelRef <> Blank()
        )
    );
    
     

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

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 724 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
SebS Profile Picture

SebS 239 Moderator

Last 30 days Overall leaderboard