Join the Webstudio community

Updated last week

Storing a Value Retrieved from Resource as a Variable

How can I store a value retrieved from Resource as a variable?
Attachment
Screenshot_2025-03-14_at_12.24.59.png
1
B
m
J
24 comments
Ah, now I read the question
We do not allow to reuse expressions
The only hack you could use is collection with single item
I tried that, but could not access the field, so I thought I should store it first as a variable
please give me example, thanks
If you are talking about error above. The editor shows you syntax error with "dot"
no, I mean I also tried this,
Attachment
Screenshot_2025-03-14_at_12.23.18.png
This is what he's saying to do.
Attachment
CleanShot_2025-03-14_at_10.11.272x.png
now i get this error?
Attachment
Screenshot_2025-03-14_at_22.01.10.png
You cannot use in resource result of another resource. This creates request waterfalls and makes server response very slow.
ok, that is why I wanted to store the value to a global variable first. whats the solution? appreciate your help
Store this parameter in url
like create a form or a link with this data and after navigation reach this dependant query
I don't know what you doing so cannot recommend anything specific
when the page loads, i want to show information in a referenced field from airtable table.
the only way to be able to filter which record's referenced record, is to use the domain, so i use the system.origin to filter the list, then need to access records on a referenced field
hopefully thanks makes sense
to be honest, this is not the only use case. I need to store many values from airtable to Global Data Variables, so I can use them in different ways. right now I can do is display the values in the page
I am building a multisite, depending on the subdomain, different info will show
You have 2 options:
  1. store the things you need to make the resource query in the url as query parameters and do it in one fetch/resource
  2. if you can't do the above because one piece of data depends on another piece of data and you need to have sequential requests fetching data one after another - you will need a separate backend that does those things for you. I could custom-code it in the cloudflare worker very easily. If that's not something you can/want use a nocode backend.
Any complex server-side data manipulation, sequential data fetching etc is currently out of scope for webstudio.
Add a reply
Sign up and join the conversation on Discord