cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Andy_Prog
Resolver I
Resolver I

Counting Items from a SharePoint List to Navigate to another Screen

Hi all,

 

I was wondering if there is a better way to read items in a list from SharePoint.

 

Currently I am reading list data in a Gallery

If(CountRows(BrowseGallery1.AllItems) >= 30, Navigate(fullScreen),
    !IsBlank(LookUp(WorkshopList_1, Title = User().FullName)), Navigate(existScreen),
    CountRows(BrowseGallery1.AllItems) < 30, Navigate(firstDate))

Unfortunately, even when the list is over 30 items it will still navigate to the firstDate screen.

 

Could anyone shed some light on this for me please?

15 REPLIES 15

@RandyHayes 

I'm sure I received an error when I used the same formula above, i will double check tomorrow morning and revert back to you as soon as possible!

 

Thank you for the support, I really do appreciate it!

RandyHayes
Super User
Super User

@Andy_Prog 

You most likely saw a delegation warning, as CountRows is not delegable.  However, given the context of what you are looking for, the delegation can be ignored.

Let me know what you discover.  Happy to help!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hey @RandyHayes

Apologies for the late response. I can confirm the formula you provided works a treat! Just hoping the delegation warning doesn't become too severe in the long run. I appreciate the assistance, thank you for your help!

 

Andy

RandyHayes
Super User
Super User

@Andy_Prog 

Yes I had specifically mentioned "given the context of what you are looking for, the delegation can be ignored."

That was intentional because the delegation warning will never cause you an issue with that formula.

You are specifically testing to see if the list count is over 30.  As long as your record limit on your App is over 30, then this will always be accurate.  The same goes for the comparison to being less than 30.

If you has some sort of filtering going on, then I would say it is a concern, but with those low numbers even if you had 1 million records, it would then simply compare to being more than 30.

The Lookup portion of the formula is delegable for the second condition of your If statement, so that will not be an issue either.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes  I will keep that in mind and take note for future reference. I read up about it but your explanation is definitely easier to understand. Thank you so much! 

RandyHayes
Super User
Super User

@Andy_Prog 

Happy to help!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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