# How to Use an Existing Example Response in a Test?

**URL:** <https://community.postman.com/t/how-to-use-an-existing-example-response-in-a-test/25880>\
**Category:** Help Hub\
**Tags:** tests, variables, collections\
**Created:** [July 19, 2021, 8:14am UTC](https://community.postman.com/t/how-to-use-an-existing-example-response-in-a-test/25880 "2021-07-19T08:14:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![localhorst](https://avatars.discourse-cdn.com/v4/letter/l/0ea827/32.png) [@localhorst](https://community.postman.com/u/localhorst)\
**Post date:** [July 19, 2021, 8:14am UTC](https://community.postman.com/t/how-to-use-an-existing-example-response-in-a-test/25880/1 "2021-07-19T08:14:26Z")

</div>

I’m writing some simple tests in postman, to validate a schema of our api.

Now I wonder if I’m able to load the example response to test against, instead of recreate everything? I’ve seen tests against previous requests by saving them in a global variable, but that’s not what I want.

I’ve got this saved response:

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/2/29bfe7b93e4ac9bb856b121260c64a9bba2d7051.png)

And want to access the saved response (since it has an ID I thought that might be possible) in my test, to test a new schema against it and check if all keys are available etc.

This is the current test, where I have to repeat, writing out the keys that I expect to be available in the object, etc.

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/4/40ac01b9f963326b062399136a583c192d18e966.png)

Any idea how to approach this?  
Thanks so much!

---

<div class="post-metadata">

**Author:** ![localhorst](https://avatars.discourse-cdn.com/v4/letter/l/0ea827/32.png) [@localhorst](https://community.postman.com/u/localhorst)\
**Post date:** [July 20, 2021, 3:12pm UTC](https://community.postman.com/t/how-to-use-an-existing-example-response-in-a-test/25880/2 "2021-07-20T15:12:15Z")

</div>

Going to answer that myself:

It could be possible, to use the Postman API, to send a request to the collection and then do some JS filter magic. Sounds like a bad idea overall.

What I ended up with is JSON Schema Validation. This appears to be the cleanest solution. The saved responses/Examples help to create JSON Schema with this tool [https://www.jsonschema.net/](https://www.jsonschema.net/), then adjust the schema an then use AJV as described here: [Checking a schema with tv4 - #2 by dannydainton](https://community.postman.com/t/checking-a-schema-with-tv4/7575/2)

JSON Schema makes a lot of sense and adds value to the API development. But it’s also a buttload of work.

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [April 28, 2025, 2:05pm UTC](https://community.postman.com/t/how-to-use-an-existing-example-response-in-a-test/25880/3 "2025-04-28T14:05:08Z")

</div>

Closed on April 28, 2025, 2:05pm UTC


