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

URGENT! Gallery not showing all items

My gallery has stopped showing all of the items. Do galleries have some type of item limit? Below is my formula to filter the gallery

 

SortByColumns(Filter('Traffic Log', StartsWith(Name, TextSearchBox1.Text), IsToday(Created)), "Date_x0020_and_x0020_Time_x0020_", If(SortDescending1, Descending, Ascending))

26 REPLIES 26

@AKotb

 

Still getting the same results. 

 

Everything was working fine until today. After doing a little research I found that my list has 502 items in it. If I delete some of the items in the list, the new ones will show up. Does powerapps have some type of item limit like sharepoint?

Anonymous
Not applicable

https://powerapps.microsoft.com/en-us/tutorials/delegation-overview/

Over 500 records needs to be delegated. The first 500 records will work without delegation.

@Anonymous

 

So do I need to adjust my formula?

 

SortByColumns(Filter('Traffic Log', IsToday( Today() ) = true, StartsWith(Name, TextSearchBox1.Text), IsToday(Created)), "Date_x0020_and_x0020_Time_x0020_", If(SortDescending1, Descending, Ascending))

 

 

Anonymous
Not applicable

I had to adjust my code when I discovered this issue. I had a filter, which is supported by delegation, but I was using operators in the filter that were not supported (exactin). I was also using User().FullName which PowerApps did not like. I changed the 'exactin' to 'in' and set the User().FullName to a context, then the filter ran without a problem and the blue warnings were gone.

This is what I ended with, and it works great (returns rows that are thousands into the data source).

DelegatedQuery.png

Comparing your code to the delegation list I would look into the use of Today. It seems to be listed in the not supported list. 

 

 

@Anonymous

 

I just need the filter to return the items from today date or is there a way to return the 30 or 40 most recent items in a list?

Anonymous
Not applicable

In my CDS data source data is stored in ascending order. So without delegation you can only retrieve your oldest 500 entries. Perhaps there is something that can be configured to change that, idk. What I would suggest, and this is what I do, is create a collection prior to building your gallery. Base your gallery off of that collection. Something like an onselect w/ a button onSelect:

 

UpdateContext({ContextToday:Today()});ClearCollect(Collection_TodayLog,Filter('Traffic Log',ContextToday = Created))

 

ContextToday is set to todays date then it is used in a filter to find records in the 'Traffic Log' data source that match the field 'Created' which needs to be a datetime because that's what Today() placed in ContextToday. I don't know your field name or data source name so I guessed. Anyway, that filter statement will delegate the processing to the server and you'll see all data past your 500th row. Then you can build your gallery off of that collection. I would suggest starting w/ a new gallery and not trying to fix the old one. 

 

Items list formula for the gallery would be something like this:

SortByColumns(Search(Collection_TodayLog, TextSearchBox1.Text, "Name"), "Name", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))

 

 

 

@Anonymous

 

So I would need to first create a new sharepoint list similar to 'Traffic Log' for temporary storage?

Anonymous
Not applicable

Your temporary storage would be within PowerApps, by using a collection (Collection_TrafficLog). Filter populates the collection from the data source named 'Traffic Log'. Then you use the collection, which is already filtered, to populate your gallery.

I was just guessing the name of your data source and guessed 'Traffic Log'. 

 

@Anonymous

 

I'm getting an error

 

Capture5.PNG

Anonymous
Not applicable

'Created' needs to be the datetime field in data source you're comparing ContextToday to. 

Helpful resources

Top Solution Authors
Top Kudoed Authors
Users online (3,808)