cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

using Filter in Gallery

Hello, I'm trying to use lookup and filter but not sure how to go about this, 

Currently I have two CDS: 

    1-   L5QuestionList {L5QuestionNumber,Heading}

    2-   QuestionHeading {HeadingID, HeadingDescription}

Capture.PNGCapture1.PNG

In PowerApps, currently I have a Gallery that display items = QuestionHeadings
headingG.PNG

 

Question: How do I filter the gallery to only display a certain heading? 
**I want it to lookup from Source L5QuestionList and only display HeadingDescription from source QuestionHeading if L5QuestionList.Heading = QuestionHeading.heading  (so that if there is no question under a heading it won't be display)

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: using Filter in Gallery

@WaMCHCH 

Here's a nice one-liner solution to your question.  Put this code in the Items property of your gallery for QuestionHeading.

 

Filter(QuestionHeading,HeadingID in L5QuestionList[@Heading])

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

4 REPLIES 4
Highlighted
Super User
Super User

Re: using Filter in Gallery

@WaMCHCH 

Here's a nice one-liner solution to your question.  Put this code in the Items property of your gallery for QuestionHeading.

 

Filter(QuestionHeading,HeadingID in L5QuestionList[@Heading])

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

Highlighted
Frequent Visitor

Re: using Filter in Gallery

Hi, @mdevaney  thank you for your reply, I have tried your code but i got error:

 

Filter(QuestionHeading,HeadingID in L5QuestionList[@Heading])

it doesn't recognize L5QuestionList  data source, so I got an error saying: "The specified  column is not accessible in this context"

 

Highlighted
Super User
Super User

Re: using Filter in Gallery

@WaMCHCH

I tested the solution using by making a collection where Heading was a string type column and it worked.  The reason it does not work you must be that Heading is a different column type such as a complex column.  I'm not sure what to do next here...

Highlighted
Frequent Visitor

Re: using Filter in Gallery

@mdevaney thank you

 

in the two CDS i have QuestionHeading with HeadingID as primary key

and in QuestionList I have a Heading which is a lookup from QuestionHeading  
I'm not very familiar with collection, I will try and look at some example and try to approach filtering with collection instead...

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,752)