Please be so kind as to read my full post before responding. Thank you for your consideration.
I am building a PowerApp for CDS/Dynamics using currently PowerApps 3.19075.21.
I am trying to find out the number of entries in a datasource, or in a "Relational Data field/table", but I don't know a robust way to retrieve this number of entries (i.e. guaranteed to give me the right result).
For example, given two entitities, "Auftrag (WA)" (Plural "Aufträge (WA)") and "Auftragsposition (WA)" (Plural "Auftragsposition (WA)"), with Auftragsposition containing a LookUp field to Auftrag, thus creating the relational data field/table 'Auftrag (WA)'.'Auftragsposition (WA)', I might want to know the number of Auftrag records or the number of Auftragsposition records associated with a given Auftrag record. I.e. something like:
This yields lots of delegation warnings Thus, for large datasets, there is the potential of those formulas not working, see also As far as I understand, using Collect first and using CountRows removes the delegation warning but won't solve my problem as Collect will also only be returning the first X entries. https://powerusers.microsoft.com/t5/General-Discussion/ClearCollect-for-more-than-2000-records/m-p/1... I understand that I can use a (scheduled) rollup field if I don't care that those numbers will only be available after scheduled rollup times. However, I require a robust way to retrieve those numbers, say, in Button.OnSelect.
Is there a function beside CountRows that I don't know about and that will do what I want?
Is there any robust way to "simply" get those numbers I want irrespective of actual size of that number and, in particular, irrespective of delegation?