cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MattHamm
Frequent Visitor

Filter() function not returning all rows

I have the following Problem:

 

I want to filter a list of Events that happened with a car eg "accident" "driver change" and so on.

 

but when i filter the list to put the results in a gallery with:

 

Filter(Event_Database; LicensePlate = varCar.LicensePlate)

 

I get incomplete results. Some rows are there some are not.

 

varCar is one Item of my car List that got selected before.

The column LicensePlate in the Event_Database is a Lookup on the Car List so there should not be any Typos.

 

the list has 429 Items right now so this should not be a delegation problem.

 

I tried to load the whole list into a local variable and still have the same problem.

 

ClearCollect(varEventList; Event_Database)

 

 

somebody has a hint for me why Filter() is not giving me the rows even if i try it local?

 

The items are on the list I checked also the local collection by just doing:

 

Last(varEventList)

 

And the last item shows up with no problems.

 

I drives me crazy that some rows are given back but others not.

 

Thank you for your Help

1 ACCEPTED SOLUTION

Accepted Solutions

@MattHamm ,

All your problems will go away if this was a simple Text field - firstly ask yourself why you need the Lookup column - I have a blog that may assist.

However dealing with your question, I am assuming varCar is simply set on an item selected in a gallery, in which case you would need something like

With(
   {wList:Event_Database);
   Filter(
      AddColumns(   
         Event_Database; 
         "Licence";
         LicensePlate.Value  
      );
      Licence = varCar.LicensePlate.Value
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

5 REPLIES 5
WarrenBelz
Super User
Super User

Hi @MattHamm ,

Are you saying 'Licence Plate' is a Lookup column? Please confirm before I comment further as if so, this is the source of your problem.

yes LicensePlate is a lookup column in my Event_Database List looking up in the car list.

@MattHamm ,

All your problems will go away if this was a simple Text field - firstly ask yourself why you need the Lookup column - I have a blog that may assist.

However dealing with your question, I am assuming varCar is simply set on an item selected in a gallery, in which case you would need something like

With(
   {wList:Event_Database);
   Filter(
      AddColumns(   
         Event_Database; 
         "Licence";
         LicensePlate.Value  
      );
      Licence = varCar.LicensePlate.Value
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

So you say I should add a new simple Text Column to my List that is basically a copy of the lookup field to use it for the Filter() function?

Did I understand that correctly?

 

I can try that. I hope that will not create a lot of overhead.

 

The lookup fields are just super convenient when working in the Lists directly.

In Powerapps I would actually not need them.

 

maybe i can concider a flow that just adds a copy of the lookup LicencePlate (thank you for correcting my spelling there by the way. I am not native in english) in a simple text everytime a new item is created.

 

I will try out that solution and come back to you.

Thank You

Hi @MattHamm ,

If you really need the Lookup field, then you have to use it (the text column I suggested was replacing it) - bear in mind that you can also create integrated forms in SharePoint to do the lookup (I have not used lookup columns for many years). They will cause you many problems in power apps including reading and writing from, filtering and sorting.

Did you try the code I sent?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,487)