Join the Webstudio community

Updated 4 weeks ago

"baserow" is not available in the scope

How can I reference a variable that I created that´s pulling API data?
Attachment
Screenshot_2024-09-29_at_09.43.06.png
c
O
J
38 comments
The variable is of type resource
works for me
Attachment
image.png
Why doesn´t it work for me ?
seems like you use lower case but defined upper case
also you defined a json, which has keys but you are trying to use the json itself in a string
need to select the right key in that json
The variable is not even an option here
Attachment
Screenshot_2024-09-29_at_11.19.37.png
So this might not be the issue
What do you mean with that?
@John Siciliano lets add something for this, seems like its not clear what JSON is exactly and what keys are and how selecting a key from a json works. I think a few screenshots could help where user can see:
  1. a json
  2. labeled what is key what is value, what is array etc
  3. how selecting keys looks like with autocomplete
https://docs.webstudio.is/university/foundations/variables#json
@cramses. for now please check out any video that shows connecting to backends like baserow, pretty sure there is a good demo of it
Pretty sure I watched every video couple of times
then I don't know the exacty problem you are having
Will do again though
I can´t use any "Resource" Variables for other variables.
I can use string variables, the system variable, number variables etc.
But Resource variables are not available for binding
This is the variable I want to reference:
Attachment
Screenshot_2024-09-29_at_11.35.50.png
Did I set it up wrong?
Are you trying to reference a Resource variable in another expression?
that currenly won't work, Resource variable is only for fetching data and using it in the bindings
maybe I still don't understand what you do, you need to share the entire thing, tell us what exactly is the goal etc.
From what I read on the first screenshots, you are trying to create a Resource variable "Baserow Images" and use "Baserow" JSON inside that resource's url.

This so far seems all fine, but your Baserow json is a json, you need to select the key you want to use in that string, meaning Baserow.something . Autocomplete tells you all available keys, also inspect tells you whts inside that Baserow json.
I am trying to reference a resource variable inside another recource variable
that won't work, this is not supported atm
Any workarounds?
Some options:
  1. check if there is a way to fetch all the data at once in one resource
  2. check if you can render the data using 2 separate variables instead of one, meaning use 2 resources instead of one
  3. add a backend for aggregating all the data you need
Data aggregation from different API calls is usually a backend task
Creating a cloudflare worker for this API aggregation woudl be best option, there is very little code need to make it work.
If looking for nocode solutions you need to start looking into all kinds of backend providers
buildship, xano and alike
ok i got around it, but can you make this feature available? This would save a lot of time!
eventually, but not this year
Hey this is actually in the Expression Editor docs but I added a link to Variables > Resources (something like once the data is fetched, use Expression Editor Bindings)
@cramses. does this have all the answers?
Haha, I think we talked past each other. My bad
I know how the expression editor works.
I was just confused why I can´t reference the resource variable in another resource variable.
Ok, that's something we should add, came up before
I solved it via cloudflare worker like you suggested.
But it was a pain. It´s just so much easier to do it with the webstudio way 😄
I believe you. We really do need a way to parallelize, combine and map/format the data coming from the api directly in webstudio, serverside. But its quite a big feature to build.
Add a reply
Sign up and join the conversation on Discord