# Some global variables do not substitute in the JSON body. Why?

**URL:** <https://community.postman.com/t/some-global-variables-do-not-substitute-in-the-json-body-why/9956>\
**Category:** Help Hub\
**Created:** [January 9, 2020, 2:41am UTC](https://community.postman.com/t/some-global-variables-do-not-substitute-in-the-json-body-why/9956 "2020-01-09T02:41:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattdesmarais1982](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@mattdesmarais1982](https://community.postman.com/u/mattdesmarais1982)\
**Post date:** [January 9, 2020, 2:41am UTC](https://community.postman.com/t/some-global-variables-do-not-substitute-in-the-json-body-why/9956/1 "2020-01-09T02:41:36Z")

</div>

Hello,  
I have a JSON body where i’m using global variables. The first instance replaces (“name”: “{{prefix}}\_test1”), but the second ( “{{prefix}}\_test2”: {} ) does not. Can anyone advise as to why ? And is there any suggested workaround ?

{  
“metadata”: {  
“name”: “{{prefix}}\_test1”  
},  
“state”: {  
“gw”: {  
“uris”: {  
“{{prefix}}\_test2”: {}  
},

I’m using Version 7.14.0 (7.14.0) on MacOS 10.14.6 (Mojave).

Thank you.  
-matt

---

<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:** [January 9, 2020, 8:44pm UTC](https://community.postman.com/t/some-global-variables-do-not-substitute-in-the-json-body-why/9956/2 "2020-01-09T20:44:42Z")

</div>

I see no obvious reason why this will not work.

Have you inspected the request body with the Postman console and are sure that the second prefix does not get replaced?

---

<div class="post-metadata">

**Author:** ![mattdesmarais1982](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@mattdesmarais1982](https://community.postman.com/u/mattdesmarais1982)\
**Post date:** [January 10, 2020, 2:09pm UTC](https://community.postman.com/t/some-global-variables-do-not-substitute-in-the-json-body-why/9956/3 "2020-01-10T14:09:03Z")

</div>

Hello @vdespa, thanks for replying. Yes i checked the postman console and it showed it was not being replaced. I did get this issue resolved by moving the global variables to environment variables, but i’m not why that made a difference. In parallel i also updated to 7.15.0 (7.15.0) and have not seen any problems.

Thanks again.  
-matt
