Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

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

(0) ShareShare
ReportReport
Posted on by 34

Hello,

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.com), or this Solved: Filter CDS with related fields in Canwas app gall... - Power Platform Community (microsoft.com) 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

  • Community Power Platform Member Profile Picture
    on at
    Re: Filter Gallery with Dataverse Text Field by Lookup in a related Dataverse table

    Hi Hsnowbee,

     

    fantastic! Thanks also for sharing!

     

    Cheers!

  • Hsnowbee Profile Picture
    34 on at
    Re: Filter Gallery with Dataverse Text Field by Lookup in a related Dataverse table

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

     

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

  • Hsnowbee Profile Picture
    34 on at
    Re: Filter Gallery with Dataverse Text Field by Lookup in a related Dataverse table

    Yes, @Anonymous , 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!

  • Verified answer
    Community Power Platform Member Profile Picture
    on at
    Re: Filter Gallery with Dataverse Text Field by Lookup in a related Dataverse table

    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

     

     

     

  • Hsnowbee Profile Picture
    34 on at
    Re: Filter Gallery with Dataverse Text Field by Lookup in a related Dataverse table

    Yes, thanks for the reply @Anonymous! 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...

  • Community Power Platform Member Profile Picture
    on at
    Re: Filter Gallery with Dataverse Text Field by Lookup in a related Dataverse table

    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

     

    Cheers,

     

    RoB

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard