SendRequest in a Pre-request Script on Collection - how to get response to set Collection Variable

Hi MDJones,

thanks for your detailed help!
I pasted your code into the Collection Pre-Script and updated my parameters and saved the changes.
When I POST a request in the collection, no error is generated, status 200.
But I can see that the Collection Variable CollRefToken is not being updated.

What is strange that in the request, the variable value of CollRefTokenDev (Refreshed Token should be used as Auth), still has an old value.

Does the Cookie play a role here? Generally, I want to use the refreshed Token in the Collection Variable CollRefTokenDev for every request, and not some value stored in a cookie.

CURL of request:

curl --location --request POST 'URL' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGcXXXXXX' \
--header 'Cookie: 5cfd47a23da9b9e1c98a84d0986d03c4=bb651d69ae861b858c8e7b91f7b51002' \
--data-raw '{
"$type": "BLA",
"Message": "Some Message expected to be received and processed by the system",
"MessageType": "BLA"
}'

I think this is related to my other post, where there is a Collection using new environment with Cookie (no value update) in comparison with a Collection using an old environment without cookie (value is being updated):

Thanks