# How to automatically update the CURRENT VALUE in an environment

**URL:** <https://community.postman.com/t/how-to-automatically-update-the-current-value-in-an-environment/45340>\
**Category:** Help Hub\
**Tags:** variables, environments\
**Created:** [March 20, 2023, 11:42am UTC](https://community.postman.com/t/how-to-automatically-update-the-current-value-in-an-environment/45340 "2023-03-20T11:42:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ztreeves](https://avatars.discourse-cdn.com/v4/letter/z/bcef8e/32.png) [@ztreeves](https://community.postman.com/u/ztreeves)\
**Post date:** [March 20, 2023, 11:42am UTC](https://community.postman.com/t/how-to-automatically-update-the-current-value-in-an-environment/45340/1 "2023-03-20T11:42:01Z")

</div>

Hi guys,

Just checking if anyone can support me with this. Every time I send a new auth call to receive a new payment\_token, I have to manually add this in my environment Current Value.

 ![Screenshot 2023-03-20 at 11.39.51](https://us1.discourse-cdn.com/getpostman/original/3X/e/7/e70a514167e6a85ac510e8071a2698a75f70e64f.png)

I know there is a way to have this automatically update when a new Post request is sent, however I have to manually update this every time.

Hopefully someone can help!

Many thanks.

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [September 14, 2023, 3:33pm UTC](https://community.postman.com/t/how-to-automatically-update-the-current-value-in-an-environment/45340/2 "2023-09-14T15:33:11Z")

</div>

You can use the `Tests` sandbox to capture different aspects of the request using the [`pm.*` API functions](https://learning.postman.com/docs/sending-requests/variables/#defining-variables-in-scripts).

This will allow you to store the data to a variable and then reference this in another request automatically using the `{{variable_name}}` syntax.

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [September 14, 2023, 3:33pm UTC](https://community.postman.com/t/how-to-automatically-update-the-current-value-in-an-environment/45340/3 "2023-09-14T15:33:16Z")

</div>

Closed on September 14, 2023, 3:33pm UTC


