Dynamic Item Count

Is there a way to add a dynamic "count’ of the items in various databases?

I would like to show on the homepage [x,xxx] (database 1) items in x,xxx categories (database 2).

Is this doable?


Here is my public share link: LINK
(how to access public share link)

Hey @mrimpossible,

A simple search in the forum finds this:

That was 2 years ago - I was curious if there was an updated or native solution available.

No trivial method exists natively. You could look at exporting your collection data, then calculate a count and store it. Using AJAX you could remotely retrieve the count and display it.

I was curious if there has been any update to this at all?

3 Likes

No.

FYI: When Webflow releases a feature they add it to updates and announcements, which is visible from your dashboard. They also normally add a topic to Official Announcements in the forums. So that is where you should check.

Hey all, I’m in need of this as well. I’m thinking of building a proper solution for this.

  • Tabulation through the Webflow API
  • Caching of tabulated numbers
  • Possible ability to query/filter in some limited ways
  • Exposing tabulated data as JSON
  • Simple widget templates to pull and display that JSON data in your site

It’s not a small project though, and might only make sense if others are interested in using it too as a paid (but cheap) SaaS solution, to help cover hosting. Anyone else keen?

Still not added yet. How hard would it be to add, the CMSes are already lists, couldn’t this be implemented in a week? Where you bind it to a field but only get the count (the number of objects in that collection), and done. Come on guys.

1 Like

Thanks for reminding me. I’ve just released v3 of my Webflow Utils library, and you can do CMS item counts now.

I’ve just added some simple docs and a demo to verify it works;

It requires a small code snipped, later I’ll think about how to best implement a no-code approach.

Setup instructions are here;

Keen to see how you use it. Share your site when you’re done.

3 Likes

Just a quick comment to say “thank you” for this utils library, Mike. I’ve just managed to build a feature that selects a random Webflow Item to display based on “N” number of Items in the Collection. Your Collection Item Count function feeds in the dynamic value of Items to the random Item picker without which, it would be impossible to create a random number.

1 Like

Sounds fantastic. Just a note in case it’s useful- depending on what you’re doing and where on your site you’re needing it, there is sort of a way to do that using a Collection List element.

  1. Drop in a collection list element, and bind it to your collection
  2. Filter it as desired, to the types of items you want
  3. Limit the number of items displayed to 1
  4. Set the sort order to “random.”

On each page refresh, you’ll get a random 1 item in the list. It’s handy for things like showing a random customer testimonial ( but only 1 or 2 ).