mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[GH-ISSUE #4723] [bug]: Resolve and display global variable values within workspace environment variables #1763
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#1763
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @iDschepe on GitHub (Feb 4, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4723
Originally assigned to: @nivedin on GitHub.
Is there an existing issue for this?
Summary
Description:
It would be highly beneficial if Hoppscotch supported nested variables, similar to how Postman handles them. This feature allows variables to reference other variables, making environment management more dynamic and flexible.
Expected Behavior:
Variables should be able to reference other variables using {{variable_name}}.
When evaluating a request, Hoppscotch should resolve nested variables recursively.
Nested variables should work in all applicable fields, including environment variables, request parameters, headers, and body content.
Use Case Example:
A user defines an environment variable:
base_url = https://api.example.comAnother variable references it:
users_endpoint = {{base_url}}/usersWhen making a request to <<users_endpoint>>, Hoppscotch should resolve it to:
https://api.example.com/usersOR
For example, a team could define a global variable:
api_version: v1Then, in an environment-specific setting, this could be reused dynamically:
api_base_url: https://api.example.com/<<api_version>>Potential Implementation:
var_a = <<var_b>>andvar_b = <<var_a>>).Would this feature be possible to add? It would greatly improve variable handling and make Hoppscotch even more powerful for API testing.
Why should this be worked on?
Why is this useful?
@liyasthomas commented on GitHub (Feb 5, 2025):
Nested variables are already possible. Please let me know if this is what you were expecting.
@iDschepe commented on GitHub (Feb 6, 2025):
Hi @liyasthomas,
Thank you for your quick response! That’s exactly what I was looking for.
myGlobalVarmyGlobalVarvariable from into an environment variable which was indicating red and showing a question mark.Honestly, I didn’t expect it to work since my global variables weren’t being resolved in the environment variable edit dialog.
Would it be possible to resolve this somehow? This might also help future users before they have to restructure their environments. Is this functionality documented, and where can I find it?
Thanks again for your support!
@liyasthomas commented on GitHub (Feb 6, 2025):
Have you selected the correct environment from the Environment Selector?
Here's my set-up:
myGlobalVar, value:hoppscotch.qwerty, value:www.<<myGlobalVar>>.io.@iDschepe commented on GitHub (Feb 10, 2025):
Hello @liyasthomas,
unfortunately, I didn’t have enough time to respond before this issue was closed. However, I was able to reproduce the behavior with the following steps:
userRunnerand assigned it a value.<<userRunner>>within our workspace environment01 Development.It appears that the display issue is specifically related to workspace environments.
Environment
01 Developmentspecifications:Best regards,
Mario
@derN3rd commented on GitHub (Mar 30, 2025):
We are running into the same issue as well, but with secrets.
We are having multiple different staging envs and I want to create a global secret e.g. API_TOKEN_PROD that I can reuse in each workspace environment (Staging, Staging 2 etc) as secret
API_TOKEN, so we don't need to create different requests for our envs with the different global secret name@iDschepe did you find a workaround for this already?
@iDschepe commented on GitHub (Apr 2, 2025):
Hi @derN3rd,
From what I understand, the "red warning" is just a display issue within the Workspace Environments.
We tested it ourselves: even if the variable — like
API_TOKENin your case — is shown in red, it should still be resolved correctly when used in a request.So please go ahead and try using the
API_TOKENvariable despite the red indicator — it should work as expected.Looking forward to hearing whether it works for you!
@derN3rd commented on GitHub (Apr 2, 2025):
I see, it works when I just ignore the red warning :)
Thanks
@AryaSvitkona commented on GitHub (Jun 20, 2025):
I observed the same issue for "nested" variables.
Version: 25.5.3
Type: Shared Environment with Team
App: WebApp & Chrome
Environment variables

Preview of the variable in the request tab

@jamesgeorge007 commented on GitHub (Jun 27, 2025):
Hi, closing this issue since it has been addressed in the latest release.
notranslateclasses #3480