# Pre-request script not incrementing an environment variable during Performance test

**URL:** <https://community.postman.com/t/pre-request-script-not-incrementing-an-environment-variable-during-performance-test/86793>\
**Category:** Help Hub\
**Tags:** performance, pre-request-script\
**Created:** [November 16, 2025, 12:47pm UTC](https://community.postman.com/t/pre-request-script-not-incrementing-an-environment-variable-during-performance-test/86793 "2025-11-16T12:47:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![martincuddy](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@martincuddy](https://community.postman.com/u/martincuddy)\
**Post date:** [November 16, 2025, 12:47pm UTC](https://community.postman.com/t/pre-request-script-not-incrementing-an-environment-variable-during-performance-test/86793/1 "2025-11-16T12:47:50Z")

</div>

Hi,

Trying to increment an environment variable in Pre-request. The script at the Collection level.

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

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/2/6/269fee86e0200c876dc4630fe3f9ff3b12ed3c8b.png)

When I run it functional it works but it doesn’t when run it in Performance mode.

Thanks.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [November 17, 2025, 4:37pm UTC](https://community.postman.com/t/pre-request-script-not-incrementing-an-environment-variable-during-performance-test/86793/2 "2025-11-17T16:37:22Z")

</div>

If I remember rightly, the environment variables are read only in performance mode. They run from the Postman cloud and has limited access to your environment. It can only read the initial value, not the current value. Not sure how you get around this.

I think I’ve seen examples that use the Postman API to updated the environment directly, but that would probably mess up the performance test as the time taken to process that additional API request would be included in the performance figures.

The following explains how to randomize requests.

[Use a data file to simulate virtual users | Postman Docs](https://learning.postman.com/docs/collections/performance-testing/performance-test-data-files/)
