It's quite common to come across a situation where you have to generate the GUID dynamically and add it to the request body or Query parameter or Request header.
For example, you want to run a request multiple times and each time you want to pass a different GUID in request body.
This can be done easily in postman without writing single line of code. Postman has a inbuilt variable for this purpose i.e $guid. you just need to wrap it inside double curly braces i.e {{$guid}}
Let's have a look at few requests where we can leverage $guid.
$guid as Query parameter
Here, I am using $guid as part of query parameter and you can also verify the actual value of guid in console. The GUID that is generated after executing the script is 6976eca-c0fd-4fd7-a819-05dedbeae3cd
$guid in Request Body
Here, I am using $guid as part of the Request Body and in console you can see generated GUID. This time the generated GUID is 61b4ff2a-062c-442d-8276-ad61a6e10894 which different from the previous section.
$guid in Request Headers
$guid can also be used in Request Headers similar to Request Body & Query Parameters. The usage is same i.e ${{guid}}.
Once you have executed the request, open the console and check Request Headers and you can see the actual guid.