Open albaquarto opened 3 months ago
I think I am missing something here. What do you mean by "correct functions for get/set variables"?
For me the variables set in the variables tab are corectly templated into the script. Could you provide a screenshot of what clarifying this?
I think I am missing something here. What do you mean by "correct functions for get/set variables"?
For me the variables set in the variables tab are corectly templated into the script. Could you provide a screenshot of what clarifying this?
Sorry, I didn't explain well. I provided an example.
Is there an existing request for this feature?
Is your feature request related to a problem?
Should be usefull using code snippet for generate requests script with also correct functions for get/set variables.
Describe the solution you'd like
1)Add postman to code snippet languages list and create a complete snippet with postman functions (also variables get/set)
2) Send a request in the script by link or id or id, but if I need some different variables I have to create a new request for every variation.
Describe alternatives you've considered
1) I use nodejs Axsios code snippet and replace the final values and the axios call with correct functions call. but is really annoyng and slow.
Additional context
Example:
I have a request like this![Screenshot from 2024-04-22 11-04-21](https://github.com/postmanlabs/postman-app-support/assets/20108095/2730a2fd-9a03-4900-9bd2-0f432704e4e9)
base-url, user-username and user-password are environment variables in the test I use the result to set the environment variable access-token
I need to use the login before a set of other requests to obtain token to use in that requestes. So I use the pre request script The pre-request script that do exactly the same thing of the preview request is this![Screenshot from 2024-04-22 11-20-48](https://github.com/postmanlabs/postman-app-support/assets/20108095/50831341-13dc-4b20-be4c-a7c8c96c05c1)
I had to write manually the pre request or I could use the code snippet tath prouce the code below and modify it to take the values from the variables.![Screenshot from 2024-04-22 11-33-55](https://github.com/postmanlabs/postman-app-support/assets/20108095/4cded327-e9f2-4245-b950-85e923b02b41)
This is a simple example but more complex situations may exist. This is why I believe that a feature like a postamn code snippet producer could be useful to produce the expected result (what I wrote in the third image) more quickly and easily.