# How can I use pre-request script's result in request's body?

**URL:** <https://community.postman.com/t/how-can-i-use-pre-request-scripts-result-in-requests-body/39826>\
**Category:** Help Hub\
**Created:** [October 6, 2022, 9:58am UTC](https://community.postman.com/t/how-can-i-use-pre-request-scripts-result-in-requests-body/39826 "2022-10-06T09:58:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LazareGiuna](https://avatars.discourse-cdn.com/v4/letter/l/7cd45c/32.png) [@LazareGiuna](https://community.postman.com/u/LazareGiuna)\
**Post date:** [October 6, 2022, 9:58am UTC](https://community.postman.com/t/how-can-i-use-pre-request-scripts-result-in-requests-body/39826/1 "2022-10-06T09:58:36Z")

</div>

I know I can set variable in script and use it in body. but I don’t want to save the variable, I want to use “return”, this works in similar tools.

example of what I want to achieve :

**pre-request script :**  
return “hello from script”

**request body :**  
{“message” : {{\*\*\*}}

is it possible? what there should be instead of \*\*\*

---

<div class="post-metadata">

**Author:** ![sbettwieser](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/sbettwieser/32/13299_2.png) [@sbettwieser](https://community.postman.com/u/sbettwieser)\
**Post date:** [October 6, 2022, 6:39pm UTC](https://community.postman.com/t/how-can-i-use-pre-request-scripts-result-in-requests-body/39826/2 "2022-10-06T18:39:45Z")

</div>

The intended way is to use variables. If you really don’t like them being saved, you can always use `pm.variables.set("var", "hello from script");` so they don’t show up in your collection or environment and will be deleted after the request has finished running. Then your request’s body can be `{ "message" : {{var}} }`.
