Query Row Count

Hi, I think I'm being really stupid but I'm struggling to find a way of returning the row count of a query. I thought this should be something like {{getData.data.length}} or something like that but I can't seem to get anything to work. I could achieve this using a transformer but my sense is that it should be a default property that i can just call upon... unless I'm just missing the point!?
Thanks,
Dave

Hi @dcsearle!

Think it might depend on the output of the query. If it's an array, you can just use what you listed. If it's an object, you'd need to convert it to an array, possibly in the transformer. The formatDataAsArray function is good for that.

-Justin

Yes, I mean the result of the query is an array but maybe not quite in the structure that works with .length so I did this and it worked :slight_smile:
{{formatDataAsArray(getData.data).length}}

Thanks @jmann

1 Like