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

Count rows in table

Hello,

 

Is there way to count the number of rows the are displayed in a powerapps table. I tried count, count and countrows but could not succeed.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Count rows in table

Hi @appbot,

OK, so this is a delegation issue.

If you don't need to update the data on your screen, one workaround is to load your data into a local collection. You could do this in the OnVisible property of your screen like so.

 

ClearCollect(SPOListCollection,
Filter(SPOList, itemexisits = Title)
)

You can then set the Items property of your data table to SPOListCollection, and you'll be able to do a CountRows on SPOListCollection without the delegation warning.

 

3 REPLIES 3
Super User
Super User

Re: Count rows in table

Hi @appbot 

You can display a count by doing a CountRows on the data source that you set for the Items property of your DataTable.

If you could screenshot/share whatever error your received when you used CountRows, or explain more precisely how it didn't work, we can guide you in the right direction.

appbot
Level: Powered On

Re: Count rows in table

Hello @timl ,

 

Thanks for the quick reply. I would like to know the count of the rows to control the visible property of  button(show button if count is equal to 1). The item property of the table is set to Filter(SPOList, itemexisits = Title) and if I add countrows to this expression I am getting a delegation warning. So inorder to avoid delegation warning I am trying to count the number of rows displayed in the table in a different way. Please, let me know if there is a different way.

 

Thanks,

Super User
Super User

Re: Count rows in table

Hi @appbot,

OK, so this is a delegation issue.

If you don't need to update the data on your screen, one workaround is to load your data into a local collection. You could do this in the OnVisible property of your screen like so.

 

ClearCollect(SPOListCollection,
Filter(SPOList, itemexisits = Title)
)

You can then set the Items property of your data table to SPOListCollection, and you'll be able to do a CountRows on SPOListCollection without the delegation warning.

 

Helpful resources

Announcements
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

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 194 members 4,465 guests
Please welcome our newest community members: