# Looking for example/tutorial for initializing a database from a JSON file

**URL:** <https://community.postman.com/t/looking-for-example-tutorial-for-initializing-a-database-from-a-json-file/6358>\
**Category:** Help Hub\
**Tags:** database, loop, jsondatafile\
**Created:** [July 7, 2019, 3:46am UTC](https://community.postman.com/t/looking-for-example-tutorial-for-initializing-a-database-from-a-json-file/6358 "2019-07-07T03:46:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![app-o-matix](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@app-o-matix](https://community.postman.com/u/app-o-matix)\
**Post date:** [July 7, 2019, 3:46am UTC](https://community.postman.com/t/looking-for-example-tutorial-for-initializing-a-database-from-a-json-file/6358/1 "2019-07-07T03:46:12Z")

</div>

I’ve built a local node server for interacting with a cloud database and I’m using Postman for the UI. I’m trying to find an example or tutorial that shows how I can loop through a JSON file to initialize the database. Things I’ve found so far have given me bits and pieces, but I’m not sure how to put it all together.

For instance, some examples that I have seen use variables in the request URL for object attributes, but these examples have only one or two attributes. My JSON objects have multiple attributes and so I am trying to see how to replace the request body for each iteration of the loop with the current object’s attribute/value pairs.

Any leads in the right direction would be greatly appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![vdespa](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/vdespa/32/2770_2.png) [@vdespa](https://community.postman.com/u/vdespa)\
**Post date:** [July 7, 2019, 10:34am UTC](https://community.postman.com/t/looking-for-example-tutorial-for-initializing-a-database-from-a-json-file/6358/2 "2019-07-07T10:34:02Z")

</div>

If I have understood your question, then try the following: [https://learning.getpostman.com/docs/postman/collection\_runs/working\_with\_data\_files/](https://learning.getpostman.com/docs/postman/collection_runs/working_with_data_files/)

---

<div class="post-metadata">

**Author:** ![murdoc-she-wrote](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/murdoc-she-wrote/32/2289_2.png) [@murdoc-she-wrote](https://community.postman.com/u/murdoc-she-wrote)\
**Post date:** [July 11, 2019, 9:37pm UTC](https://community.postman.com/t/looking-for-example-tutorial-for-initializing-a-database-from-a-json-file/6358/3 "2019-07-11T21:37:12Z")

</div>

> My JSON objects have multiple attributes and so I am trying to see how to replace the request body for each iteration of the loop with the current object’s attribute/value pairs.

Couldn’t you accomplish this with dynamic variables, such as “property”: “test {{$guid}}”, in the body? You could seed/hydrate your database with iterations using the Collection Runner or newman.

Or do you have a static dataset that you want to recreate each time?
