cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper V
Helper V

Filter using "in" doesn't get all items

Hello,

 

My filter doesn't seem to work very well and i don't know how to fix it. 

 

I'm using powerapps to get all people in my departments. In order to do this, i have list with all the people and their respective department.

 

In order to get the user department and id i use the following filter:

 

Collect(colColab;Filter('DATABASECOLAB';Lower(Email) = Lower(User().Email)))

 

After that, in order to get all the people working in that department, i do the following filter:

 

Collect(colAgencias;Filter(EOColaboradores;IdEstrutura in colColab.IdEstrutura))

 

The problem is, with the following filter i get only a portion of the results instead of all of them. 

If i put the filter of IdEstrutura by hand, (Ex: Collect(colAgencias;Filter(EOColaboradores;IdEstrutura = 1234)) ) it will get all the colabs, but using 'Collect(colAgencias;Filter(EOColaboradores;IdEstrutura in colColab.IdEstrutura))' (which it should be the same thing), gets me 4 people instad of all 7. 


Any ideias how to fix this? Thank you

4 REPLIES 4
Dual Super User III
Dual Super User III

'in' isn't delegable on most of the data source types, especially Office 365 SharePoint.  So if your data source has more than 500 records using IN for a filter will only get the ones that are in the first 500.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

@Field 

 

You can increase the delegation limit in the App settings to max 2000.

 

However please note delegation means Power Apps will load the first x (x - delegation limit) records in memory and then perform your query.

 

If you want to learn more about delegation

https://www.youtube.com/playlist?list=PLTyFh-qDKAiE6ia-D94Qk5-AzpN4dqOmD

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks,
Reza Dorrani, MVP
YouTube
Twitter

Hello,

 

I have increase the delegation limit in the App settings to max 2000 but for some reason, it still doesn't show all. 


Is there any workaround for this?

Dual Super User III
Dual Super User III

Increasing the delegation limit to 2,000 simply means that it will check the first 2,000 records in the data source.  If you have more than that you still won't get complete results.  You need to find a delegable way to do your Filter.  That means you can't use "in".  The typical workaround is to use StartsWith() instead.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Solution Authors
Top Kudoed Authors
Users online (35,217)