Join the Webstudio community

Updated 2 months ago

Working with received data in the expression editor

At a glance

The community member is seeking methods to work with data received in the Expression editor, specifically to select three random blog posts from a list obtained through a CMS request. The community members discuss that the Expression editor has a limited subset of JavaScript, and there is no built-in random function. One community member suggests using a backend, such as a Cloudflare worker, to build a thin layer between the CMS (Baserow) and the web studio. Another community member mentions they will try to implement this on n8n, which is more familiar to them.

Useful resources
Hi friends, what are some methods to work with the received data in Expression editor?
For example I get from cms request a list of blog posts :
https://api.baserow.io/api/database/rows/table/123456/
and I need to select three random ones, for block read our blog articles. How to do it? in the same baserow api there is no random parameter, so I need to make random and slice already in webstudio. How to solve this? Maybe there is some tutorial? I don't quite understand how Expression editor works. How freely can js be used there?
J
O
a
4 comments
Theres no random function though
This type of thing you would need to use a backend for, in your case you are using baserow as a backend, if it doesn't allow this you would need a backend in between. I would use a cloudflare worker and build a thin layer between baserow and webstudio if you really need this
Thanks for the replies friends, I get the idea, I'll try to implement it on n8n, it's more familiar to me πŸ™
Add a reply
Sign up and join the conversation on Discord