Hey everyone, I’d like to return the quantity of each category but I feel for scalability reasons I dont want the hit on the users end. Maybe some external site that can handle the logic and just return a value?
if so what’s the best site that can do that, I’ve not messed with anything external as of yet.
It’s really no hit at all, as long as the information you need is in the page. Personally I’d take the client-side JS approach unless you’re dealing with > 300 items.
Make .com is decent, however this is actually somewhat difficult to achieve, because the CMS API does not support querying. The normal flow would be-
- Capture webhooks for new item created, item updated, and item deleted
- Perform a full recalc ** - get all items, count up the categories, update the categories
** Necessary because otherwise an item update that removes a category wouldn’t be detected for an incremental update
However as the count of items and categories increases, you’ll quickly risk exceeding your API rate limits when these updates occur.
You could go for a cruder approach, which is to create a special admin page which loads all of your items and categories and does the counts- then populates forms that allow you to push the quantity update manually to Make. Logic could be used also but comes with some downsides.
One problem I’m having is getting round pagination. If I’m to pull the names and do some basic matching of strings and counting them up I can only view what pagination has loaded so far.
That’s why I suggested 300 items as a max.
You can get 100 items per collection list, just set them with the same filter and sort and then range them 1-100, 101-200, 201-300