# How to store json value in external data for postman test

**URL:** <https://community.postman.com/t/how-to-store-json-value-in-external-data-for-postman-test/5936>\
**Category:** Help Hub\
**Created:** [June 17, 2019, 9:39am UTC](https://community.postman.com/t/how-to-store-json-value-in-external-data-for-postman-test/5936 "2019-06-17T09:39:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anton39](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@Anton39](https://community.postman.com/u/Anton39)\
**Post date:** [June 17, 2019, 9:39am UTC](https://community.postman.com/t/how-to-store-json-value-in-external-data-for-postman-test/5936/1 "2019-06-17T09:39:05Z")

</div>

Hi guys,

for example I have an external json file like:  
[{  
“category”: “1”,  
“example”: [  
{  
“Something”: {  
“SomethingA”: “1086716”,  
“SomethingB”: “300079”  
}  
}  
]  
}

how can I check in the test-script my request response, which is a json with the:  
“example” value, which provides a json?

Thanks

---

<div class="post-metadata">

**Author:** ![aamir.ahmed](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@aamir.ahmed](https://community.postman.com/u/aamir.ahmed)\
**Post date:** [June 17, 2019, 11:08am UTC](https://community.postman.com/t/how-to-store-json-value-in-external-data-for-postman-test/5936/2 "2019-06-17T11:08:31Z")

</div>

Hi @Anton39,

We cannot access an external JSON file for a request but we can access a single external JSON file for a collection run.The external JSON file has to be imported as shown in the image before you run the collection.

 ![ExternalJSONforRunner](https://us1.discourse-cdn.com/getpostman/original/3X/4/f/4fef45de3b5adff95d6cdabc303c569cc801ddcc.png)

If you would need to access the data within an imported JSON file and set it as an environment variable, you would have to execute the following command in your test script to get the example array:

**var data = pm.iterationData.get(JSON.stringify(data[0].example[0]));**  
**pm.environment.set(“example”, data);**

Here is a link to an article describing collection runs:  
[https://learning.getpostman.com/docs/postman/collection\_runs/intro\_to\_collection\_runs/](https://learning.getpostman.com/docs/postman/collection_runs/intro_to_collection_runs/)
