# How to Save Iteration Response Data to Iteration Variable in Global

**URL:** <https://community.postman.com/t/how-to-save-iteration-response-data-to-iteration-variable-in-global/42250>\
**Category:** Help Hub\
**Tags:** variables, response, iterations\
**Created:** [December 21, 2022, 5:08am UTC](https://community.postman.com/t/how-to-save-iteration-response-data-to-iteration-variable-in-global/42250 "2022-12-21T05:08:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nafisakashim](https://avatars.discourse-cdn.com/v4/letter/n/9e8a1a/32.png) [@nafisakashim](https://community.postman.com/u/nafisakashim)\
**Post date:** [December 21, 2022, 5:08am UTC](https://community.postman.com/t/how-to-save-iteration-response-data-to-iteration-variable-in-global/42250/1 "2022-12-21T05:08:06Z")

</div>

Hi,

I want to save the response for each data iteration as variable in Global. Example the response body showing the access\_token, and I would like to save this as variable.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/f/6/f6bfc8ded3991a0ca4b3915deaa8e219511d01ac.png)

For one time iteration I can do as below,  
//Set variable  
var response = pm.response.json();  
pm.globals.set(“accessToken”, response.access\_token)

But if I want to do for iteration more than one, how to set the variable as accessToken[Iteration1], accessToken[Iteration2] and so on…

Btw, I am running the iteration by uploading the CSV file.

Please help me. Really clueless about this.

Thanks in advance.
