Cannot count the number of rows in a table when it has a default filter

Hi, I am trying to use {{table_name.data.length}} to count the number of rows in my table, but it does not seem to work when my table is filtered.

As you can see below, I have a default filter on this table for where Type includes Collection and where the Delivery Day is = todays date.

As you can see, I cannot count this number of rows when it is filtered, how else could I do this?

Hi @Kilian_Boshoff, I'm assuming that filtered data of the table is being converted to an object rather than an array. You can check collection_orders_due_today.data when you're filtering and probably adjust the value there to something like collection_orders_due_today.data[order_number].length or something.

Again, these are assumptions so better to view your filtered data's structure.

1 Like

I managed to figure it out another way:

I used a JSON to SQL query

Then referenced that in the statistic component:

Nice workaround and opens new use cases!

3 Likes