Cannot access global variable in test response body

I have set up a mock server with an endpoint and test for it.
My goal is to use the variable passed in the request body and return it in the test response body.

In request, I write the required value to the global variable, but I cannot reach it inside the test response. - the variable is not replaced.

Request body

{
“gasAccountIds”: [
“3878591-1”
]
}

Request pre-request script:

for (let i=0; i <JSON.parse(request.data).gasAccountIds.length; i++) {
pm.globals.set(“gasAccountId” + (i + 1), JSON.parse(request.data).gasAccountIds[i]);
}

Actual response:

{
“summaries”: [
{
“atest”: “{{gasAccountId1}}”
}
]
}

Test body:

{
“summaries”: [
{
“atest”: “{{gasAccountId1}}”

    }
]

}

Global variables: