I’m attempting to create a request that uses a custom variable in both the request URL and Body. If I create a Pre-request Script variable like this:
pm.environment.set("Id", "test");
then everything works just fine. However, if I do something like this:
pm.environment.set("Id", "{{$guid}}");
then I end up with a different value in the URL and the Body.
I assume this has something to do with the the {{$guid}}
variable value being created by a function. With this in mind, I updated my Pre-request Script to assign the {{$guid}}
variable result to a const local variable… but I still see the same behavior.
const value = "{{$guid}}";
pm.environment.set("Id", value);
Is it possible to use the {{$guid}}
variable in this case?
Thanks!