# Environment variable not updated in flows

**URL:** <https://community.postman.com/t/environment-variable-not-updated-in-flows/79947>\
**Category:** Help Hub\
**Tags:** tests, variables, postman-flows\
**Created:** [May 13, 2025, 8:44pm UTC](https://community.postman.com/t/environment-variable-not-updated-in-flows/79947 "2025-05-13T20:44:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![orbital-module-tec12](https://avatars.discourse-cdn.com/v4/letter/o/e79b87/32.png) [@orbital-module-tec12](https://community.postman.com/u/orbital-module-tec12)\
**Post date:** [May 13, 2025, 8:44pm UTC](https://community.postman.com/t/environment-variable-not-updated-in-flows/79947/1 "2025-05-13T20:44:08Z")

</div>

I have found a few topics on this issue from previous poster, but it isn’t clear to me what i have done wrong and the responses haven’t always helped. When i run these http request in collection one at a time, there is no issue. The environment variable updates, and I can pass this into future requests in order to continuing testing. In flows however, a user is create, the id is generated, but the variable doesn’t update leading to issues further down the line. Am I missing something?

The addition of the get and create variable here are attempts to try and get the problem (uncessfull). I had originally simply ran a post-script for when the user is created

```auto
// Save user ID as an environment variable

pm.environment.set("user_id", responseJson.id);

});

```

Thank you in advance

 ![Screenshot 2025-05-13 at 21.40.54](https://us1.discourse-cdn.com/getpostman/original/3X/7/4/74938fad131d51748318b5da281c3a34a89f1743.png)

---

<div class="post-metadata">

**Author:** ![flows-daniel](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/flows-daniel/32/25516_2.png) [@flows-daniel](https://community.postman.com/u/flows-daniel)\
**Post date:** [May 13, 2025, 9:06pm UTC](https://community.postman.com/t/environment-variable-not-updated-in-flows/79947/2 "2025-05-13T21:06:03Z")

</div>

Hi @orbital-module-tec12

Welcome to the forums!

We don’t support updating Environment variables from within Flows at this time.

From your screenshot, you have two choices:

1. Directly connect Create User to Update User and then select the path to user\_id [[Docs Example](https://learning.postman.com/docs/postman-flows/build-flows/create-connections/#using-one-blocks-output-as-another-blocks-input)]
2. You will need a select block before your create variable block user\_id in order to parse out just the user\_id field. Then your get variable block can be used as the input for user\_id in your Update User request rather than the send port that it’s connected to now

Let me know if you run into any further issues!

---

<div class="post-metadata">

**Author:** ![docking-module-techn](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/docking-module-techn/32/34315_2.png) [@docking-module-techn](https://community.postman.com/u/docking-module-techn)\
**Post date:** [December 17, 2025, 4:24pm UTC](https://community.postman.com/t/environment-variable-not-updated-in-flows/79947/3 "2025-12-17T16:24:07Z")

</div>

Hi @orbital-module-tec12 , want to let you know that Request pre/post-scripts can now mutate environment variables within Flows (only supported in flow modules for now). Steps to follow:

1. Upgrade to the latest app version.
2. Open your flow module.
3. Hover over your HTTP Request block, select the gear icon, and ensure “Allow scripts to update environment variables” is enabled.

 ![Screenshot 2025-12-17 at 11.20.12 AM](https://us1.discourse-cdn.com/getpostman/original/3X/d/c/dcec5d3e3f7fc275eb775348378d1b94e34d6c63.png)

Here’s a small video showing these steps:
