Can I set a variable with another variable?

I thought I had this working but then it stopped working.

I have authentication tokens with different capabilities that I am testing.
I want to easily switch between these tokens so that I can test exactly the same request with different authorizations.

So I defined two collection variables UserToken and SuperToken.
Then I assign another collection variable ApiToken to be either {{UserToken}} or {{SuperToken}}

Here’s a screenshot of the collection variables

But you will notice that when I type {{ I don’t get the variable selection popup.
I went ahead and filled it in with {{SuperToken}} but there is no variable substitution.
Here’s another screenshot of an attempt to use {{api-token}} in a request

Thanks for any ideas.

I understand what you’re after and I’m using something similar but I’m using a slightly different approach.
You may already be aware of this but to me it is not clear from your post.
I use an environment (SuperToken in your case) and one variable (in your case api-token) but that get’s one single value (in your case SuperToken).
Then I copy the environment to an environment called UserToken and replace the SuperToken value with the one from UserToken.
Now the only thing you need to do is just select the appropriate environment for your tests.

If you’ve already tried this and doesn’t satisfy your needs, then I’m appologize for creating false hopes.


Thanks for the idea. I see how that works. Rather than doing value assignment you are overloading the name api-token using different environments. That will work.

It would be cooler though to have value assignment.