# How to use different Environments in one collection

**URL:** <https://community.postman.com/t/how-to-use-different-environments-in-one-collection/60559>\
**Category:** Help Hub\
**Tags:** tests\
**Created:** [May 2, 2024, 10:54am UTC](https://community.postman.com/t/how-to-use-different-environments-in-one-collection/60559 "2024-05-02T10:54:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![technical-engineer16](https://avatars.discourse-cdn.com/v4/letter/t/a698b9/32.png) [@technical-engineer16](https://community.postman.com/u/technical-engineer16)\
**Post date:** [May 2, 2024, 10:54am UTC](https://community.postman.com/t/how-to-use-different-environments-in-one-collection/60559/1 "2024-05-02T10:54:04Z")

</div>

I have a list of environments:

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/1/b/1b852ba452f4da56dd7b61a5371b2ef702b7e441.png)

**Use case:**  
The first API uses env1 and saves the data  
Second API uses env2 and saves data

The only solution I was able to find is to use set.env function but why should I change the params in my envs if I already configured them and I need to use them on the same collection but in a different API request?

---

<div class="post-metadata">

**Author:** ![gbadebo-bello](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/gbadebo-bello/32/12175_2.png) [@gbadebo-bello](https://community.postman.com/u/gbadebo-bello)\
**Post date:** [May 2, 2024, 3:14pm UTC](https://community.postman.com/t/how-to-use-different-environments-in-one-collection/60559/2 "2024-05-02T15:14:17Z")

</div>

Hi @technical-engineer16. Welcome to the Postman Community!

Why are you saving these variables in different environments since they’re both in the same collection? Is there any caveat to having them in the same environment?

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [June 1, 2024, 3:15pm UTC](https://community.postman.com/t/how-to-use-different-environments-in-one-collection/60559/3 "2024-06-01T15:15:09Z")

</div>

Closed on June 1, 2024, 3:15pm UTC

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