Hello,
I’ve created both Environment and Collection variables and added them to the Headers section of a GET request. When I hover my mouse over the variables in Postman, I can see the variable values however when I send the request the values are NULL (in the Postman console).
Is there some trick I need to follow to actually insert them into my GET requests? using version 6.7.3 on Windows 10
How are you calling the variable? For example if you variable is url. You will call it in your get by passing{{url}} in your string.
Yes, I am including the variable and they have values but when I click the Send button nothing is inserted into the request. seems to happen with only one of my collections.
Also, the CURRENT value is NULL but I thought if you set null in the variable setup it would inherit the INITIAL value. Is that not the case? See image:
That’s why.
You’ve set the variable at the environment “initial value” but the “current value” is empty.
You need to set it here when running the tests in Postman application.
Perhaps we should raise a feature request to the Postman team to use the initial value is the current value is empty?
1 Like
Sorry, I don’t know if I should piggyback on this or start a separate topic, but I’ve never understood why there is this initial/current value distinction. I’ve read the docs at https://learning.getpostman.com/docs/postman/environments_and_globals/variables but couldn’t understand the purpose of this distinction. Is there more information about that somewhere I can read up on?
Hey @carsten.dreesbach.op. Sorry for the delay in response.
To summarise, the initial-current value distinction allows you to work collaboratively without affecting your team’s workflows. Whatever you set as the current value is not synced to our servers and thus do not affect your team mate’s environment who might be using the same.
Anything you put as the initial value is synced and is reflected in your team mate’s environment as well. This basically gives you a local session
to work with for your shared environments, without disrupting others.
We talk about it in detail here.
Feel free to reach out in case you have additional questions.
1 Like
Got it, thanks! Might be nice to add a reference to that article to the doc page I linked above.
Thank you for the advice, will share internally.
Or a tooltip icon next to “Initial Value” and “Current Value” which explains the difference when the user mouse hovers over it?
@postman-paul540 The tooltip is there in the Manage Environments modal which pops up if you click on Edit in the quick look viewer. Can you open a feature request if you feel it should be there in the quick look view as well? Some one from the team could then evaluate the possibility.