Hi to all,
Tired of clicking on each table to see how many records it has?
This snippet helps when you want to:
-
Avoid exceeding your plan’s record limit - quickly see which tables are consuming the most records
-
Track your app’s growth over time - monitor how your data is expanding across different objects
-
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
