How set up one specific "value" for all pairs "key"="value" in the body before sending Request

Hi everyone!
I’d like to ask if I can set up one specific “value” for all pairs “key”=“value” in the body before sending Request.
My request body:
{
“shop_status”: “GOLD”,
“city”: “LA”,
“name”: “Beard Shop”
“offers”: [
{
“created_at”: “2020-04-15T15:14:03.548282Z”,
“offer_id”: “oof010329182”,
“amounr”: “320”,
},
{
“created_at”: “2020-04-02T15:14:03.548282Z”,
“offer_id”: “oof010329183”,
“amounr”: “180”,
},
{
“created_at”: “2020-04-01T15:14:03.548282Z”,
“offer_id”: “oof010329184”,
“amounr”: “750”,
}
}

I need to set up the one date for all “created_at” keys. How can I do it?

Hey @asadchenko,
You can set a Postman variable in your pre-request script (https://learning.postman.com/docs/postman/variables-and-environments/variables/)

pm.variables.set('created_at', new Date().toISOString()) // Or any data you want to specify

And in your request body you can just use {{created_at}} for the value of your created_at key. For example:

{
“shop_status”: “GOLD”,
“city”: “LA”,
“name”: “Beard Shop”
“offers”: [
{
“created_at”: “{{created_at}}”,
“offer_id”: “oof010329182”,
“amount”: “320”,
}

thanks, but this doesn’t work for me because I’m getting the Body for this request from the response of the other request. I need to create an universal solution for my question because I’m getting different bodies for different shops.