So, to summarize... a table object is not really a table for countrows. Is that correct? Also, its no good if you have over 500 items resulting in your filter, because it is subject to delegation.
Is there another way to do this to get a full count?
It's a shame we can't use DataTable1.Items as the input to the CountRows function. I have a fairly complex Filter formula in my table Items property. I have to copy that formula to the label where I want to show the count which is not good for maintainability.
I understand what you're saying - it would be much better if it were possible to access DataTable1.Items. Perhaps this is something that you could post in the ideas forum?
Here's something else you could try (although I've not tested it thoroughly). The gallery control exposes a property called AllItems. Therefore, you could add a gallery control to your screen and set the Items property of the gallery to your complex Filter formula. You can then set the visible property of your gallery to false, and then set the Items property of your data table to the AllItems property of the gallery. In your label, you can carry out a CountRows on the AllItems property of the gallery.
That way, there will only be a single instance of your complex filter formula, and it would reduce the risk of you updating the formula in the data table, and forgetting to update the CountRows formula in your label.
Thanks @timl I posted an idea.
I have considered just switching to use a gallery control instead of the data table. There are advantages to each, and having the AllItems property is certainly an advantage of the gallery over the data table. Your suggestion is an interesting alternative in using both that I might explore more.
Fill out a quick form to claim your user group badge now!
Find out where you can attend!
Features releasing from October 2019 through March 2020
Learn how to build the business apps that you need.