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 III
Super User III

@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

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 III
Super User III

@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

@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 III
Super User III

@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

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (43,457)