How to see the number of records in each tables

Hi to all,

Tired of clicking on each table to see how many records it has?

This snippet helps when you want to:

  1. Avoid exceeding your plan’s record limit - quickly see which tables are consuming the most records

  2. Track your app’s growth over time - monitor how your data is expanding across different objects

  3. Satisfy curiosity - get a quick overview of your app’s data distribution

Just copy/paste this line below to your app’s console:

console.table([{name: `TOTAL`, obj: ``, count: Object.entries(Knack.app.attributes.counts).filter(([k]) => k.startsWith(`object_`)).reduce((sum, [,v]) => sum + v, 0)}, ...Object.entries(Knack.app.attributes.counts).filter(([k]) => k.startsWith(`object_`)).sort((a, b) => b[1] - a[1]).map(([k, v]) => ({name: Knack.objects._byId[k]?.attributes.name || `Unknown`, obj: k, count: v}))])

You will see a nice table, like this:

Enjoy,

Norm

3 Likes

Norm

Thank you once again for another helpful piece of code.

Dean

1 Like

Cheers @NormandDefayette_CortexRD - thanks for sharing a very handy snippet.

1 Like

Nice. Knack should add a summary of all the App Tables inside the Builder, as a more detailed breakdown of the current overall App summary.

Thankyou! Very helpful.

Michael,

Here it is now!!

See my post: See the number of records in the Builder! With Kneuron extension

Norm

1 Like

Nice!! good job.

1 Like