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 gallery through...
Power Apps
Unanswered

Filter gallery through multiple entities

(0) ShareShare
ReportReport
Posted on by 11

I have three entities in the CDS with the following fields:

-Assessment: AssessmentID (primary key), AssessmentName

-AssessmentQuestions: AssessmentQuestionID (primary key), AssessmentID (lookup to Assessment), QuestionTextID (lookup to QuestionText)

-QuestionText: QuestionTextID (primary key), QuestionText

 

There are two galleries: one for Assessment and QuestionText.

 

What I am trying to do is to have the Assessment gallery display across the top and the QuestionText gallery down the side. As the user selects different options in the Assessment gallery, the questions in the QuestionText gallery will be filtered.

 

I am having trouble figuring out a way to get the QuestionText gallery to filter. The QuestionText gallery does not necessarily need to read directly from the QuestionText entity. I have not as of yet had luck using the AddColumn/LookUp process to get the second gallery (QuestionText) to show the necessary data.

 

Any help or advice? Thanks! 

I have the same question (0)
  • TimRohr Profile Picture
    669 on at

    Provided you have the Relationships established between your entities, then if the user selects an assessment from the Assessment gallery, the Question gallery should be able to filter its Items. The Data should be set to AssessmentQuestions, and the Items property to:

    Filter(AssessmentQuestions,AssessmentID=Assessment_BrowseGallery.Selected.AssessmentID)

    Then, on each entry in that gallery, you would have a label to pull in the Question text... this *should* work, but I've had trouble with this formation recently (see the next option for a workaround):

    ThisItem.QuestionTextID.QuestionText

    If the above doesn't work, use a LookUp() in the Text property of the label:

    Lookup(QuestionText, QuestionTextID=ThisItem.QuestionTextID,QuestionText)

    If neither of the above options work, make sure you have your Relationships properly defined in CDS.

     

    HTH

  • JacksonP Profile Picture
    11 on at

    Hey Tim,

     

    Thank you for your help. What you suggested did not work. I am unsure if PowerApps allows filtering based on reference fields in a Canvas App. 

     

    I was able to get around the need of filtering using information I found in the below article:

    https://powerapps.microsoft.com/en-us/blog/one-to-many-relationships-for-canvas-apps/

     

  • TimRohr Profile Picture
    669 on at

    I'm glad you got something workable, but I thought I would just add:

     

    If by "reference fields" you mean the lookup field creating the relationship between your 2 entities, then... yes, you should be able to filter based on that. For instance, if you have many questions associated with one assessment, you should be able to pick the assessment in one part of your app, then filter the Questions datasource to be only where the Assessment field (a lookup to the Assessment entity) is the Assessment you have chosen.

     

    If you want to explore it more, post a bit more of your data and we can work it out.

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

Last 30 days Overall leaderboard