# Looping Strategies?

**URL:** <https://community.postman.com/t/looping-strategies/35761>\
**Category:** Help Hub\
**Tags:** postman-sandbox\
**Created:** [May 30, 2022, 1:05am UTC](https://community.postman.com/t/looping-strategies/35761 "2022-05-30T01:05:03Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [May 30, 2022, 8:34am UTC](https://community.postman.com/t/looping-strategies/35761/2 "2022-05-30T08:34:15Z")

</div>

Hi @rtfmoz2

This may help you…

> [@Scripting the reset of collection variable to its initial value](https://community.postman.com/t/scripting-the-reset-of-collection-variable-to-its-initial-value/20620/3):
>
> if you still want to reset then use : Add this to first request’s pre-request script: pm.environment.set("resetValue",pm.collectionVariables.toJSON().values) This wiil store all initial value to resetValue variable And in the last request’s test script use pm.environment.get("resetValue").forEach((a)=\>pm.collectionVariables.set(a.key,a.value)) Now we are resetting all collectionVariables to the initially saved value

---

_[View the full topic](https://community.postman.com/t/looping-strategies/35761)._
