cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
appbot
Frequent Visitor

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

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

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
Frequent Visitor

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,

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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