# Use variable in body raw text not like json

**URL:** <https://community.postman.com/t/use-variable-in-body-raw-text-not-like-json/46468>\
**Category:** Help Hub\
**Tags:** variables\
**Created:** [April 18, 2023, 9:14am UTC](https://community.postman.com/t/use-variable-in-body-raw-text-not-like-json/46468 "2023-04-18T09:14:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![technical-saganist-7](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@technical-saganist-7](https://community.postman.com/u/technical-saganist-7)\
**Post date:** [April 18, 2023, 9:14am UTC](https://community.postman.com/t/use-variable-in-body-raw-text-not-like-json/46468/1 "2023-04-18T09:14:01Z")

</div>

How to use variable in body RAW text ?

Hi community,

I have defined a variable in the pre-request script of my collection called “DateNow” like that :

> var DateNow = new Date().toISOString().replace(/(.\d{3})|[^\d]/g,‘’);  
> postman.setEnvironmentVariable(‘DateNow’, DateNow);

Now i must pass this variable in the body raw text of my HL7 message like that :

> MSH|^~&|Soft1||Soft2||{{DateNow}}||SIU^S12^SIU\_S12|1dc8ed8b21d8502f2199|P|2.5.1|||||FRA|UTF-8

but the {{DateNow}} still remain text and not variable.

How can i do it ?

Best regards,

Jouvence
