# Is it possible from a POST to put the value of a returned object into a variable to be used in a global variable in a later test

**URL:** <https://community.postman.com/t/is-it-possible-from-a-post-to-put-the-value-of-a-returned-object-into-a-variable-to-be-used-in-a-global-variable-in-a-later-test/2188>\
**Category:** Help Hub\
**Created:** [July 30, 2018, 1:44pm UTC](https://community.postman.com/t/is-it-possible-from-a-post-to-put-the-value-of-a-returned-object-into-a-variable-to-be-used-in-a-global-variable-in-a-later-test/2188 "2018-07-30T13:44:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yorkes](https://avatars.discourse-cdn.com/v4/letter/y/5e9695/32.png) [@yorkes](https://community.postman.com/u/yorkes)\
**Post date:** [July 30, 2018, 1:44pm UTC](https://community.postman.com/t/is-it-possible-from-a-post-to-put-the-value-of-a-returned-object-into-a-variable-to-be-used-in-a-global-variable-in-a-later-test/2188/1 "2018-07-30T13:44:08Z")

</div>

I am creating a record in a postman test that returns values. I’d like to take the value  
“{  
“userId”: 103345,…”  
for userid and put it into a global variable so that I am able to use it in later tests.  
I have a pre-request script that I am running as well and have tried to understand how to do this for a post request from [Save JSON as variable an pass to body later](https://community.postman.com/t/save-json-as-variable-an-pass-to-body-later/1881)

If there is an old article on information that I missed that might help with a solution please point me to this.  
Thanks

---

<div class="post-metadata">

**Author:** ![jrsiegel](https://avatars.discourse-cdn.com/v4/letter/j/9d8465/32.png) [@jrsiegel](https://community.postman.com/u/jrsiegel)\
**Post date:** [July 30, 2018, 3:42pm UTC](https://community.postman.com/t/is-it-possible-from-a-post-to-put-the-value-of-a-returned-object-into-a-variable-to-be-used-in-a-global-variable-in-a-later-test/2188/2 "2018-07-30T15:42:37Z")

</div>

I think you might want to look at this page: [https://www.getpostman.com/docs/v6/postman/environments\_and\_globals/variables](https://www.getpostman.com/docs/v6/postman/environments_and_globals/variables)

Hopefully that answers your question!
