Join the Webstudio community

Updated 2 weeks ago

Removing the https:// from the system.origin variable

Hello, is there a way to cut out or remove the https:// from the system.origin ? I can’t seem to manipulate inside the expression editor. Thanks (fyi I use this variable to make up a dynamic value for a resource url and needs to be accessible on the entire site)
O
m
32 comments
Can't do this with expressions. I am sure there is another way but for this I need to better understand why you need this
Ok, so I use the site.origin value to fetch data from specific table in airtable. For example, this https://api.airtable.com/v0/appxxxxxxx/$site.origin to get the value of the domain testsite123.wstd.io and so the end result should be https://api.airtable.com/v0/appxxxxxxx/testsite123.wstd.io NOT https://api.airtable.com/v0/appxxxxxxx/https://testsite123.wstd.io
Would be good if you could make more system variables available. , see example from WeWeb
Attachment
Screenshot_2025-04-10_at_15.38.38.png
agree regarding more system variables, but generally it seems like you want to do data processing
data processing is a backend task, in the very broad sense
manipulating data, validating data etc
you seem to not have a backend at all, you are just sending from the frontend directly to airtable
does airtable have ability to do these things maybe?
I am not sure what you mean by data processing. Essentially I need to get the a value from the browser environment to fetch data from the correct table in Airtable.
Airtable does not have any way to receive eneviromental data from the user's browser.
you are taking data in the browser, then you want to manipulate that data into some form - that's processing
you are already sending them all data needed, what you want is to have there a function that will manipulate it before saving
stripping protocol from the url is processing
you could get away if we provided a version without protocol, but tomorrow you will get stuck somewhere else if you do complex things and don't have a proper backend
if I can get the base domain without the https://, I would not have the need to process data.
I would use a proper backend, if there was a way to send the enviromont to the backend (meaning send the the base domain) then process it and receive back to the frontend
you already send that url from builder to airtable, right?
I just want to use it to formulate the resource url
that means you already have that data that you could send to the backend and manipulate it to the format you need
you would send it to the backend, not to airtable, backend would manipulate it and send to airtable
ok, how do you send something to a backend?
just like you send it to airtable right now
airtable is acting as your backend right now
you mean formulate a resource like this; with url like this: https://api.backend.com/webstudiosite=https://testsite123.wstd.io backend receives this request, then it manupilates the data, communicates with airtable and sends back appropriate data?
yes, though api can be anything, webstudio doesn't care
btw I think baserow provides ways to do these things, not sure though, feel free to check
Ok noted, I assume the https// (the double back slashes should not interfere with the url?
gpt says baserow also can't do it
it recommends automation tools like n8n/make
I would also consider a custom worker if you are not afraid of a bit code
noted, thanks I will find a way
FYI, I used n8n webhook as the api resource, when its called, it triggers a workflow and retrieves the relevant data and sends it back with a Webhook Response node, so sweet!
Add a reply
Sign up and join the conversation on Discord