Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Filter Gallery with Dataverse Text Field by Lookup in a related Dataverse table


I have a listing of courses in a custom Dataverse table (Courses table). When users add a course to their shopping cart in the app, it is patched to another custom table in Dataverse (Staff Training Table) with the Course Title and the user's name so the user's 'shopping cart' is saved even after the app is closed. The "Course Title" field is a Lookup Field in the Staff Training Table that relates to the Courses Table.  


I have a gallery that I am using to display courses in the user's shopping cart, but I cannot figure out how to filter the gallery items (the gallery data source is the Courses table) to display only those courses that were patched to the Staff Training table (e.g. the shopping cart) during the user's current or prior session. I think I am trying to do something similar to this: Solved: Filter SharePoint List from Lookup Column in Anoth... - Power Platform Community (microsoft...., or this Solved: Filter CDS with related fields in Canwas app gall... - Power Platform Community (microsoft.c... but I am having trouble figuring out how to apply those solutions to my scenario. Can someone help me with how to approach this? Thanks in advance!


Filter(Courses, 'Course Title' in ForAll('Staff Trainings', 'Course Title'.Value And Name=MyUserFullName*))


*variable with the user's name


Accepted Solutions

I think it would be easier. You can use then in your gallery the following properties:


'Staff Trainings'.'Course Title'.description

'Staff Trainings'.'Course Title'.cost

'Staff Trainings'.'Course Title'.vendor name




View solution in original post


Hi HSnowbee,


have you thought of using the Staff Training Table as Gallery Data Source?


You can select columns of the Courses Table directly thanks to Dataverse relationship management.


Filter('Staff Trainings', Name=MyUserFullName)


You can select the columns in Courses with the .field notation.


I.e. if your Course Table has a column "Type", you can show this field by using 'Staff Trainings'.'Course Title'.Type


I'm linking to additional documentation:

Using Microsoft Dataverse with a canvas app in Power Apps - Power Platform | Microsoft Docs





Yes, thanks for the reply @Roberto-Budelo! That would certainly make things simpler, but the Staff Trainings table does not have all of the course details (e.g. description, cost, vendor name, etc) and I would like to be able to display those details in the shopping cart gallery. Do you think it would be eaiser to make Staff Trainings the gallery source data, and then pull those detail fields from the related Courses table? I have not tried that approach yet...

I think it would be easier. You can use then in your gallery the following properties:


'Staff Trainings'.'Course Title'.description

'Staff Trainings'.'Course Title'.cost

'Staff Trainings'.'Course Title'.vendor name




Yes, @Roberto-Budelo , I think that is a good work-around! If you don't mind, could I bother you with one more question on this topic? The Vendor Name in the Course table is a LookUp from a Vendor table. I tried using ThisItem.'Course Title'.Vendors.'vendor name', but it did not work. Do you happen to know how I could display that lookup field? Thanks again for your help!

Frequent Visitor

Okay, just to close the loop on this - I found the answer to my question regarding pulling in the Vendor's name from another related table. I was receiving an error regarding multiple relations and the solution was here: Solved: how to overcome multiple levels of relationship ex... - Power Platform Community (microsoft....


LookUp('Courses', 'Course Title'=ThisItem.'Course Title'.'Course Title', Vendor).'Vendor Name'

Hi Hsnowbee,


fantastic! Thanks also for sharing!



Helpful resources

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

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