Join the Webstudio community

Updated last month

Is there any way to dynamically insert a string into another string, inside Global Data Variables?

At a glance
Use Case:
I'm building out a template for myself to access an API. The API requires a key matching a dedicated store (changes with every project).

Is there a way to change a single string, call it the dedicated Store Slug, and then have that populate into the Resource API call?

This way, all I'll have to do on a project is to change the dedicated Store Slug and all else will populate.
O
t
7 comments
you need to use a variable inside of a string and that string is part of a resource, right?
if I understand corrrecly your use case you just need to use a template string in the binding
Plain Text
`asomething${variable}something`
Yes, this is what I was trying. And I probably don't understand the context, but I tried adding that to the URL portion of the Resource call but get an invalid URL.
Attachment
image.png
It's one of those mornings.... I put in backticks but didn't do it in the expression editor. The backticks in the text box turned to apostrophes instead.
Add a reply
Sign up and join the conversation on Discord