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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter items in galler...
Power Apps
Unanswered

Filter items in gallery based on data in another collection

(0) ShareShare
ReportReport
Posted on by 190

Hi,

 

I would like to filter the items in a gallery by a value which is stored in another collection ("Service_Results") than the collection which is shown in the gallery ("Equipments").

 

I tried this filter, but it does not work:

Filter(
 Equipments; 
 LookUp(Service_Results;ID=Gallery2_3.Selected.ID;Damages)=true 
)

 

Thanks,

Lukas

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    Hi @Lukas1 ,

    Assuming the ID of Service_Results is in the Gallery2_3 selected item

    Filter(
     Equipments; 
     LookUp(
     Service_Results;
     ID=Gallery2_3.Selected.ID
     )
    )

     Please click Accept as solution 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 Thumbs Up.

  • Lukas1 Profile Picture
    190 on at

    Thanks for you reply.

     

    In the collection "Service_Results" I have a column called "Damages" (Boolean). Based on this value (true or false) I want to show the items in the gallery.

     

    It seems to me as if your suggested LookUp-formula is not complete?

     

    Lukas

  • v-siky-msft Profile Picture
    on at

    Hi @Lukas1 

     

    What is the relationship between Equipments and Service_Results?

    Could you please share more logic about your requirements? In another word, If Damages value is true, what data about Equipments do you want to display?

     

    From the codes, we cannot find any relationship between Equipments and Service_Results. This code is equivalent to

     

    Filter(
    Equipments; 
    true
    )

     

    or

     

    Filter(
    Equipments; 
    flase
    )

     

    In general, it should have a related column to implement such kind Filter. 

    Please share more information about your logic implement, so that we can provide further assistance.

    Sik

     

  • Lukas1 Profile Picture
    190 on at

    @v-siky-msft Thanks and yes, the relation is probably missing.

     

    I thought I can do that by having the ID of the Equipments-list as foreign key in the "Service_Results" list:

     

    Equipments:

    ID | Name | .....

     

    Service_Results:

    Equipment_ID | Damages

     

    My workaround is to have a column "Damages" directly within the Equipments-list. 

     

    But I would still be interested how to get a relation to another collection for filtering.

     

     

  • v-siky-msft Profile Picture
    on at

    Hi @Lukas1 ,

     

    OK.

    What is the kind of data source? SharePoint list, right?

    So I assume 'Equipment_ID' column is a lookup column from 'ID' column of Equipments list, right?

    Please try this:

     

    Filter(
    Equipments; 
    LookUp(Service_Results; Equipment_ID.Id = Equipments[@ID] && ID=Gallery2_3.Selected.ID;Damages)=true 
    )

     

    or

     

    Filter(
    Equipments; 
    LookUp(Service_Results; Equipment_ID.Id = Equipments[@ID];Damages)=true 
    )

     

    Note: the formula is not delegable, so it can only handle a maximum of 2000 records.

    Sik

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

Forum hierarchy changes are complete!

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

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard