cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
WaMCHCH
Level: Powered On

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

WaMCHCH
Level: Powered On

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"

 

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

WaMCHCH
Level: Powered On

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,747)