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 in a gallery Da...
Power Apps
Unanswered

Filter in a gallery Dataverse Lookup column

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I'm busy with an app based on Dataverse. I've tables with Projects and SalesOrders. Both related with the column Projectnumber.

Have a Gallery of the projects, but From there I want to go to a seperate page with the Salesorders, just for the selected project. But it keep getting errors.. tried a lot of formula's, but this would my best option. What are your thougths?

 

Filter(SalesOrders,ProjectNumber=RecordsGallery1.Selected.ProjectNumber)

 

THanks a lot

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @BodemWeter -

    Assuming you have a relationship between both tables, and the relationship cardinality is in a one-to-many direction, or many-to-one direction between the Sales Orders table and the Project table, try:

     

    Filter(
     SalesOrders,
     RecordsGallery1.Selected.ProjectNumber = 'Your Lookup Column'.ProjectNumber
    )

     

  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    Assuming you have a relationship between the "Projects" table and the "SalesOrders" table based on the "ProjectNumber" column, you should be able to filter the "SalesOrders" table to show only those related to the selected project. Here's how you can write the formula:

     

    Filter(SalesOrders, ProjectNumber = RecordsGallery1.Selected.ProjectNumber)

     

    Here's a breakdown of the formula:

    • Filter: This function is used to filter records in a data source.
    • SalesOrders: This is the data source from which you want to filter records.
    • ProjectNumber: This is the name of the column in the "SalesOrders" table that you want to compare.
    • RecordsGallery1.Selected.ProjectNumber: This is how you reference the selected project number from your Gallery of projects. Make sure that "RecordsGallery1" is the correct name of your Gallery, and that "ProjectNumber" matches the column name in the "Projects" table.

    If you're still encountering errors, make sure to ask further questions.

    If this solves your issue make sure to give this a thumbs up and mark as solution. Thanks

  • BodemWeter Profile Picture
    on at

    Hi ShaheerAhmad,

     

    This is exactly the same formula as I wrote. It gives the issue, 'Incompatible types for comparison. These types cant be compared: Record, Text.

     

     

  • BodemWeter Profile Picture
    on at

    Hi Imran,

     

    Thanks for your reply. This solution also gives the issue: 'Incompatible types for comparison. These types cant be compared: Text, Record.

    note, now is text first, then Record. 

     

    thanks for more idea's:)

  • BodemWeter Profile Picture
    on at

    Actually, when I tried something more.

    When I use: Filter(Salesorders, SalesOrderNumber,"SO-1000") it works fine. 

    When I use: Filter(Salesorders, ProjectNumber,"Proj-1000") it gives a fault

    When I use: Filter(Salesorders, SalesOrderNumber,RecordsGallery1.Selected.SalesOrderNumber) it works fine

    When I use: Filter(Salesorders, SalesOrderNumber,RecordsGallery1.Selected.ProjectNumber) it gives a fault.

     

    It looks like the ProjectNumber does't exist in the SalesOrder table. Because When I make a dropdown list, with items 'SalesOrder' I cannot have the value ProjectNumber. It looks like it is because it is a LookUp column, does that make sense? And how to solve?

     

    Thanks

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @BodemWeter I will leave you with @ShaheerAhmad 

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