cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tbrantley
Level: Powered On

Re: URGENT! Gallery not showing all items

@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?

Backslider88
Level: Power Up

Re: URGENT! Gallery not showing all items

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

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

tbrantley
Level: Powered On

Re: URGENT! Gallery not showing all items

@Backslider88

 

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

 

 

Backslider88
Level: Power Up

Re: URGENT! Gallery not showing all items

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. 

 

 

tbrantley
Level: Powered On

Re: URGENT! Gallery not showing all items

@Backslider88

 

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?

Backslider88
Level: Power Up

Re: URGENT! Gallery not showing all items

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

 

 

 

tbrantley
Level: Powered On

Re: URGENT! Gallery not showing all items

@Backslider88

 

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

Backslider88
Level: Power Up

Re: URGENT! Gallery not showing all items

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'. 

 

tbrantley
Level: Powered On

Re: URGENT! Gallery not showing all items

@Backslider88

 

I'm getting an error

 

Capture5.PNG

Backslider88
Level: Power Up

Re: URGENT! Gallery not showing all items

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

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 53 members 3,311 guests
Please welcome our newest community members: