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

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,734)