# Reseting current values to initial values through sendRequest within a Monitor execution

**URL:** <https://community.postman.com/t/reseting-current-values-to-initial-values-through-sendrequest-within-a-monitor-execution/43568>\
**Category:** Help Hub\
**Tags:** monitors, variables, environments, collections, setenvironmentvariab\
**Created:** [February 3, 2023, 4:33pm UTC](https://community.postman.com/t/reseting-current-values-to-initial-values-through-sendrequest-within-a-monitor-execution/43568 "2023-02-03T16:33:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![paytonmclo](https://avatars.discourse-cdn.com/v4/letter/p/6de8d8/32.png) [@paytonmclo](https://community.postman.com/u/paytonmclo)\
**Post date:** [February 3, 2023, 4:33pm UTC](https://community.postman.com/t/reseting-current-values-to-initial-values-through-sendrequest-within-a-monitor-execution/43568/1 "2023-02-03T16:33:14Z")

</div>

Within a Postman **Monitor** , is there a valid way to set an environment’s current values to its initial values through **pm.sendRequest()** or any other method in the pre-request script or test script?

 ![Image 2-3-23 at 4.29 PM](https://us1.discourse-cdn.com/getpostman/original/3X/5/1/51f8bcd678b58cba4e1945f588c492f928c8b1cd.jpeg)

I found that the approach I was taking only updated the initial value, so subsequent requests didnt actually obtain any updated environment variable values.

I’ve tried all the pm.environment.set() and pm.iteratedData.set() etc. functions but have had no luck as those apparently do not function within a monitor’s scope. Anyone have an idea?

---

<div class="post-metadata">

**Author:** ![Kurmavatar](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kurmavatar/32/3026_2.png) [@Kurmavatar](https://community.postman.com/u/Kurmavatar)\
**Post date:** [February 7, 2023, 10:58am UTC](https://community.postman.com/t/reseting-current-values-to-initial-values-through-sendrequest-within-a-monitor-execution/43568/2 "2023-02-07T10:58:39Z")

</div>

Hi @paytonmclo,

If you create a variable, and update it using `pm.environment.set()` it will only be persisted throughout the monitor run, once the run finishes the value of that variable will not be available. If you want to persist value between monitor runs you can use [Postman’s API](https://www.postman.com/postman/workspace/postman-public-workspace/documentation/12959542-c8142d51-e97c-46b6-bd77-52bb66712c9a) as that will update the initial values of a variable, allowing the monitors to access those values between the runs. This article below should help you with it:

> **[How to dynamically set the initial value for a variable](https://support.postman.com/hc/en-us/articles/11532548145303-How-to-dynamically-set-the-initial-value-for-a-variable)**
>
> You can modify the initial value of a variable from a script using the Postman API. This article explains how to use the endpoint Update Environment, which consists of replacing an existing environ...
