Hello,
well, this is the case, when software should not be too smart 
I have a following script:
console.log(response.date);
pm.collectionVariables.set("Created_Document_Creation_Date", response.date);
console.log(pm.variables.get("Created_Document_Creation_Date"));
Here is an output:
2023-01-01T05:50:50+01:00
2023-01-01
If I change the variable name to āDocument_Creation_Dateā (Iāve tried 4-5 different names) the output changes to:
2023-01-01T05:50:50+01:00
2023-01-01T05:50:50+01:00
Hey @vadimlammcgm 
Welcome to the Postman Community 
Do you have any variables set with the same name at a different scope (global, environment)?
Do you see the same if you do:
console.log(response.date);
pm.collectionVariables.set("Created_Document_Creation_Date", response.date);
console.log(pm.CollectionVariables.get("Created_Document_Creation_Date"))
Ohhh⦠it was quite stupid 
There was a variable in the environment scope⦠Thanks for the advise!
1 Like
Glad to see you got it sorted. 
If a variable with the same name is declared in two different scopes, the value stored in the variable with narrowest scope will be used. For example, if there is a āusernameā global variable and a āusernameā local variable, the local value is used when the request runs.