# Postman how to get request body with already substituted variables

**URL:** <https://community.postman.com/t/postman-how-to-get-request-body-with-already-substituted-variables/4821>\
**Category:** Help Hub\
**Created:** [April 3, 2019, 10:05am UTC](https://community.postman.com/t/postman-how-to-get-request-body-with-already-substituted-variables/4821 "2019-04-03T10:05:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mp222](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@mp222](https://community.postman.com/u/mp222)\
**Post date:** [April 3, 2019, 10:05am UTC](https://community.postman.com/t/postman-how-to-get-request-body-with-already-substituted-variables/4821/1 "2019-04-03T10:05:17Z")

</div>

Hi,

could you help me with one thing

I need to save request body (json with variables) to use it later in my prerequest script. Unfortunately when I display request data

console.log(request.data);

It looks for example like this:

{

“session”: “{{session}}”,

“playerid”: “{{playerid}}”,

“currency”: “{{currencyCode}}”,

“action”:

{ “command”: “com”,

“parameters”: {

“country”: “{{countryCode}}”

} } }

Is there a possibility to get request body in Pre-req. with already substituted variables?

---

<div class="post-metadata">

**Author:** ![tmccann](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/tmccann/32/3550_2.png) [@tmccann](https://community.postman.com/u/tmccann)\
**Post date:** [April 5, 2019, 12:05pm UTC](https://community.postman.com/t/postman-how-to-get-request-body-with-already-substituted-variables/4821/2 "2019-04-05T12:05:59Z")

</div>

Where are you putting the `console.log()` statement?  
If you are putting it in the Pre-Request tab then this is expected to be the output as the request has not been made yet and as a result not populated.

If you move this statement to the Tests tab, it will populate those values for you.

---

<div class="post-metadata">

**Author:** ![mp222](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@mp222](https://community.postman.com/u/mp222)\
**Post date:** [April 5, 2019, 1:07pm UTC](https://community.postman.com/t/postman-how-to-get-request-body-with-already-substituted-variables/4821/3 "2019-04-05T13:07:48Z")

</div>

Hi, I need it in pre request script, console.log just checking if I can get this data to use it later in prerequest.  
I have a solution already, we can close the topic thank you 🙂
