Using 2 environments at the same time

Hello!

I’m creating a collection where it would be great if I could mix and match 2 different environments.

Specifically I need to have a USER and APP environment. For example, I could have a Production USER and a Sandbox USER which need to interact with App1 APP and App2 APP. Is there a way I could mix and match these 4 environments without needing to create separate environments the combine elements between them?

Hey @paulmccudden :wave:

Welcome to the Postman Community! :postman:

Short answer is, no. :grimacing:

In the builder, you can only have a single active environment set and not multiple ones at the same time. You could use the other variable scopes to add that data but that then becomes a bit messy and probably the reason you have the data in separate multiple environments.

There could be something that you can do with Flows, where you can select different requests and assign a different environment to each.

Thank you for the welcome Danny! I’ve been using postman for a few years, but am starting to use it more often and with increasing complexity.

Flows looks awesome. I hadn’t heard of it before. However not sure if it’s the best answer in this case since it’s testing single calls at a time, just in different environments.

What I ended up doing was set up 3 environment variables for each user values: production, sandbox and current. I set up 2 different API calls that in the Tests section sets the environment variables for either the Sandbox user or Production user. The actual API call doesn’t do anything (uses https://postman-echo.com/get).

Do you think this is a good solution for this? Would you recommend anything else or adjusting anything?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.