# Saving response from all pages into a single variable

**URL:** <https://community.postman.com/t/saving-response-from-all-pages-into-a-single-variable/15097>\
**Category:** Help Hub\
**Tags:** response, pagination\
**Created:** [August 18, 2020, 3:56am UTC](https://community.postman.com/t/saving-response-from-all-pages-into-a-single-variable/15097 "2020-08-18T03:56:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Balakrishna.Mandala](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Balakrishna.Mandala](https://community.postman.com/u/Balakrishna.Mandala)\
**Post date:** [August 18, 2020, 3:56am UTC](https://community.postman.com/t/saving-response-from-all-pages-into-a-single-variable/15097/1 "2020-08-18T03:56:55Z")

</div>

Hi,

I am trying to retrieve the records from the database that are created during a period. For that I use below GRAPHQL variables and sending the request.

{

“start” : “2020-08-13T13:28:10Z”,

“end” : “2020-08-13T13:55:18Z”,

“page” : “1”

}

When I send the request, it returns hundreds of records in response.Each page displays only 25 records. If we send request for page 1 it will display only page 1 records. If we send request for page 2 it will display only page 2 records. I am able to save the respective page response into a variable. If the pages are more than one page, in the response it will display a link saying that we have a next page as below.

“links”: {  
“next”: “?query=query ($start: String!, $end: String!, $page: Int!) { itemClassUpdates(start: $start, end: $end, page: $page) { page totalPages start end events { event itemClass { handle code erpCode description discontinued createUser createDate updateUser lastModified itemSubclasses { handle classHandle code erpCode description defaultUnitHandle discontinued createUser createDate updateUser lastModified } } } } } &variables={"start":"2020-08-13T13:28:10Z","end":"2020-08-13T13:55:18Z","page":2}”  
},

My challenge is, i want to save the first page response into a variable and then the request should be sent for next page and the second page response also i want to append to the same variable.

Is this possible in postman?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![ben.johnson.go](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/ben.johnson.go/32/5290_2.png) [@ben.johnson.go](https://community.postman.com/u/ben.johnson.go)\
**Post date:** [August 18, 2020, 9:11am UTC](https://community.postman.com/t/saving-response-from-all-pages-into-a-single-variable/15097/2 "2020-08-18T09:11:45Z")

</div>

I have a very similar post and problem to this based upon automation of queries and appending of paginated responses into a single variable (or JSON file). Look forward to a response - although a similar post I saw got 0 replies… ☹

Crossing everything for you! I already looked and couldnt find anything on here or google to do this from scratch - although it is VERY possible. Just. How. ☹
