cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User III
Super User III

@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
Super User III
Super User III

@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

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"

 

@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...

@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
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (3,445)