Hi All, I have come across a strange 'anomaly' when using the CountRows function as follows. It is easily reproducible.
Let's say we have a gallery, which shows all our records as normal from any data source. Now we need to select 'edit gallery' and add a checkbox control (so that it shows one for each row). Now we add a label outside the gallery, which will serve to display a 'count' value of how many records we have selected via the checkboxes which appear next to each row.
The formula is: CountRows(Filter(Gallery1.AllItems, Checkbox1.Value)) & " selected"
When we go to preview, it works fine as expected as can be seen by the first picture, where the label states '3 selected' as expected.
However, let's say we had separate identical gallery. We then do 'edit gallery' as before, but we add a Container in first, then a checkbox control as before, with the usual fields as previously. Again, we add a label control just like before to do our 'counting'.
It has a similar formula as before which is: CountRows(Filter(Gallery1_1.AllItems, Checkbox2.Value)) & " selected".
However, as we now have a container, when we preview our app and select a checkbox, it does not count the number of selected rows. Instead, I get a total which is equivalent to the total number of records I have. This is shown in my next screen-shot, where I've only selected one row, but '96 selected' is shown in the label instead of '1 selected'.
Instead of '1 selected' we see '96 selected''
I guess it is because the checkbox is nested within the container, but has anyone experienced this before and more importantly, is there are way around this so that we can get a correct 'count' figure, other than not using a container?
Thank you all in advance!