Using initial values as default current values

I’ve read many questions on the forum about how to copy a variable’s Current value to its Initial value. I have something of the opposite problem and would appreciate any advice.

We’re setting up a shared Postman library for our team, with potentially hundreds of saved GraphQL and REST API queries across several applications and six (and counting) operational environments. My goal is to make it as simple as possible for my teammates to set up and use this library. In particular, every query must work seamlessly across environments by picking up the necessary variables (mostly a base URL).

Every user will have their own set of personal access tokens for each environment. I expect that everyone will define their PAT’s per app/environment in their vault, using a set naming convention (like “token-(application)-(environment)”, e.g.: “token-app123-prod”). I’d like it so that these vault variables are the only things that need defining by each user. I’ll define the other necessary variables at the appropriate levels, collection or query.

For this to work as I want, however, Postman would seem to need to be able to use a variable’s Initial value (persisted to our workspace) as the Current value, unless of course the user overrides the Current value locally. I don’t see how to accomplish this. If I define a variable and provide an Initial value, the user must manually copy that to their Current value before executing the query. This would be very tedious for queries that have a dozen or more variables.

Is there a way to make this work as I hope? Thanks in advance.

(tagging @danny-dainton)

1 Like

You shouldn’t have to copy the values from the intial to current.

My understanding is that the intial value will be copied to the current value if one is not set.

Is there a setting of some sort to enable this? I’m on a Mac, and it is definitely not happening. It could be user error, of course, but I can’t see what if anything I’m doing wrong.

I’ve tested this and can confirm that it doesn’t seem to use the initial value if the current value is missing.

The documentation explains this…

Store and reuse values using variables | Postman Docs

When you create a new variable in Postman, if you leave the current value empty, it autofills with the initial value.

What you can do, is go to the variables tab on the collection, and select the 3 dots to the right of the current value column.

One of the options is ‘reset all’, and this will copy all of the initial values to the current values.