# Pre-request script in performance mode

**URL:** <https://community.postman.com/t/pre-request-script-in-performance-mode/72038>\
**Category:** Help Hub\
**Tags:** performance, pre-request-script\
**Created:** [December 4, 2024, 11:18am UTC](https://community.postman.com/t/pre-request-script-in-performance-mode/72038 "2024-12-04T11:18:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![orbital-module-tec10](https://avatars.discourse-cdn.com/v4/letter/o/ebca7d/32.png) [@orbital-module-tec10](https://community.postman.com/u/orbital-module-tec10)\
**Post date:** [December 4, 2024, 11:18am UTC](https://community.postman.com/t/pre-request-script-in-performance-mode/72038/1 "2024-12-04T11:18:37Z")

</div>

I use pre-request script for each request. Script updates request body and headers.  
When I send request or run collection pre-request script updates body. but it does not work for performance mode.  
In pre-request I used pm.request.body.raw =, and set actual body to variable (global, environment, collection). None of these methods worked.  
How I can set ‘unique’ request body for performance mode?

---

<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:** [January 20, 2025, 4:09pm UTC](https://community.postman.com/t/pre-request-script-in-performance-mode/72038/3 "2025-01-20T16:09:37Z")

</div>

Hi @orbital-module-tec10. Welcome to the Postman Community!

Pre-request and post requests scripts should work in Postman’s performance testing environments. How are you able to ascertain that pre-request scripts are not working? It may be helpful to share more information about what you’re trying to update specifically, what you expect to see when you run the performance tests vs what you see.

This can help us understand the problem much better and provide helpful recommendations.

---

<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:** [January 20, 2025, 4:26pm UTC](https://community.postman.com/t/pre-request-script-in-performance-mode/72038/4 "2025-01-20T16:26:49Z")

</div>

Opened on January 20, 2025, 4:26pm UTC



---

<div class="post-metadata">

**Author:** ![orbital-module-tec10](https://avatars.discourse-cdn.com/v4/letter/o/ebca7d/32.png) [@orbital-module-tec10](https://community.postman.com/u/orbital-module-tec10)\
**Post date:** [February 17, 2025, 12:37pm UTC](https://community.postman.com/t/pre-request-script-in-performance-mode/72038/5 "2025-02-17T12:37:02Z")

</div>

During performance test I try set unique value in body for each request (using pre-request).  
But postman sent the same request body  
If I send request manually or in collection run, code in pre-request is worked

---

<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, 11:42am UTC](https://community.postman.com/t/pre-request-script-in-performance-mode/72038/6 "2025-11-16T11:42:38Z")

</div>

did you ever figure the problem? …have the same issue. thanks
