# How to stub iteration data when not using CollectionRunner

**URL:** <https://community.postman.com/t/how-to-stub-iteration-data-when-not-using-collectionrunner/19706>\
**Category:** Help Hub\
**Created:** [January 29, 2021, 5:08pm UTC](https://community.postman.com/t/how-to-stub-iteration-data-when-not-using-collectionrunner/19706 "2021-01-29T17:08:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lunar-module-pilot-6](https://avatars.discourse-cdn.com/v4/letter/l/aeb1de/32.png) [@lunar-module-pilot-6](https://community.postman.com/u/lunar-module-pilot-6)\
**Post date:** [January 29, 2021, 5:08pm UTC](https://community.postman.com/t/how-to-stub-iteration-data-when-not-using-collectionrunner/19706/1 "2021-01-29T17:08:10Z")

</div>

Hey.

I am trying to test our my collection in Postman prior to using Collection Runner.

When I change my scripts to use pm.iterationData, everything works fine in the Runner. However, if I want to run a one off request in my collection without using the runner (and not loading the associated data file) I get null values for anything defined in the data file (pm.iterationData.get(…)).

What is the best way to solve this? I really don’t want to add a pre-request script for each request to ensure that values are defined or to do some sort of defaulting.

---

<div class="post-metadata">

**Author:** ![praveendvd](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/praveendvd/32/6796_2.png) [@praveendvd](https://community.postman.com/u/praveendvd)\
**Post date:** [January 29, 2021, 11:35pm UTC](https://community.postman.com/t/how-to-stub-iteration-data-when-not-using-collectionrunner/19706/2 "2021-01-29T23:35:35Z")

</div>

if you use pm.environment.get,pm.iterationDat.get etc it will retrieve only the specific varaible in that scope. If you want to get an variable irrespective of the scope use.

`pm.variables.get("test")`

This will return the value of variable with name test in any scope , local,environment,collection. data etc depending up one the precedence.

Meaning if environment and data variable has same name then the value will be from data as precedence is opposite to scope

---

<div class="post-metadata">

**Author:** ![lunar-module-pilot-6](https://avatars.discourse-cdn.com/v4/letter/l/aeb1de/32.png) [@lunar-module-pilot-6](https://community.postman.com/u/lunar-module-pilot-6)\
**Post date:** [February 1, 2021, 2:09pm UTC](https://community.postman.com/t/how-to-stub-iteration-data-when-not-using-collectionrunner/19706/3 "2021-02-01T14:09:57Z")

</div>

Awesome! Thank you.

I will use pm.variables instead.
