# How to deal with input JSON with varying array lengths when reading from external file

**URL:** <https://community.postman.com/t/how-to-deal-with-input-json-with-varying-array-lengths-when-reading-from-external-file/11491>\
**Category:** Help Hub\
**Created:** [March 23, 2020, 6:19pm UTC](https://community.postman.com/t/how-to-deal-with-input-json-with-varying-array-lengths-when-reading-from-external-file/11491 "2020-03-23T18:19:50Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![dbraus](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@dbraus](https://community.postman.com/u/dbraus)\
**Post date:** [March 25, 2020, 7:48pm UTC](https://community.postman.com/t/how-to-deal-with-input-json-with-varying-array-lengths-when-reading-from-external-file/11491/3 "2020-03-25T19:48:28Z")

</div>

I figured out the answer to this question: Its the same answer I posted in the following link: [Comparing API response to JSON in an external file](https://community.postman.com/t/comparing-api-response-to-json-in-an-external-file/11490/)

You can pass the entire JSON in, assign it to an environmental variable in the pre-req using pm.iterationData.get , and then call that environmental variable in the body

---

_[View the full topic](https://community.postman.com/t/how-to-deal-with-input-json-with-varying-array-lengths-when-reading-from-external-file/11491)._
