Accesing CMS data via Javascript

Hello Community, I want to kow if there is a way where I could get data from my CMS collections via Javascript. I need to pass some information through a couple of pages, in the first page I am trying to copy the data to a localStorage so I can get it in the pages I need it.

The problem is in the first page where I have the CMS Collection List, I am filtering the collection, but when I’m trying to Set the localStorage it keep copying ALL the data and not just the one that is filter (all of this did it in an embeded custom code).

I would love to do a Javascript where I can get the data like a database query, get Data_1 from User_1. Is there a way?

Thanks,


Have a look at the classes applied to those filtered elements. You should be able to identify which are filtered out, and removed them from your data set.

You can do some fairly advanced data manipulations using Xano and Wized, however natively there is not any support in Webflow for querying the CMS, or even directly accessing it from script. That include API access.

1 Like

Thanks for your answere Michael, I still can’t do what I want it to do, but I get I work around with Collection Pages for the moment. But I will make some testing with your proposals and see if I can do it more like I want it.

Hi @Miguel_Salazar :wave: welcome to the forum.

Another quick alternative is to just use a free Make (Integromat) account.

  1. Use Javascript on your front to ping a Make Webhook.
  2. Then query your Webflow CMS (filtering happens here).
  3. Return a JSON blob via a Webhook response module.

Your Javascript consumes the returned JSON blob and displays it.

For step #2 you’ll need a middle layer if you’re not querying by item id.

I usually use a Webhook to automate CMS backups into Airtable (step-by-step tutorial) - which then allows for free form searching (lookup tables) from Make / Integromat.

Once you’ve outgrown that solution, you swap in something more robust, or code your own middle layer.

This is the “quick start” iterative approach :wink: until you need more.

Hope that helps!

1 Like