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

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

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,

timl
Super User III
Super User III

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
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 Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (52,344)