-
-
Save mattruma/85b20276cc591e77cccc885fb1398a92 to your computer and use it in GitHub Desktop.
Adventures with Postman: Dynamic Variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "", | |
"name": "", | |
"email": "" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var name = pm.variables.replaceIn('{{$randomFirstName}} {{$randomLastName}}'); | |
var email = name.replace(' ',''); | |
pm.variables.set('name', name); | |
pm.variables.set('email', name.replace(' ','')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "{{$guid}}", | |
"name": "{{name}}", | |
"email": "GMAIL_USER_NAME+{{email}}@gmail.com" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"createdOn": "2020-08-04T12:37:44.6674816Z", | |
"email": "GMAIL_USER_NAME+MalcolmReynolds@gmail.com", | |
"id": "51fbe6de-c063-4f77-9551-49505c90178d", | |
"name": "Malcolm Reynolds", | |
"object": "User", | |
"updatedOn": "2020-08-04T12:37:44.6674816Z", | |
"userId": "51fbe6de-c063-4f77-9551-49505c90178d" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment