cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Highlighted
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.

 

View solution in original post

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,

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

 

View solution in original post

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,795)