Open rvq opened 6 years ago
@RvQ Thanks for suggestion, I am adding as feature on ui/ux.
In mean time you can try using pre-request script to dynamically assign header value, so that you can group all similar header values to an array,
please refer docs for more information, https://www.getpostman.com/docs/v5/postman/scripts/pre_request_scripts
I would also be very interested in a feature like this. I use global variables and environment variables, but often routes have parameters that have a set of valid responses and it would be nice to share a route to my team with param=[hardtospelloption1,hardtospelloption12,hardtospelloption123,hardtospelloption1234,...] and be able to select from the list which parameter to send in the request.
Is there a way to do that with the Pre-Request Scripts?
This may also provide a simple solution for most use cases in #2621!
The absence of this feature may be a deal breaker for my company. I will be pitching Postman to our QA department in a few weeks.
It would also be very helpful to add a description to each drop-down value. In the example below, there is a {{priority}}
variable which can have the value "0" or "1". "0" stands for "normal" and "1" for "urgent". This can be easily mixed up when testing. We could have a form like the following:
| Value | Description |
| ----- | ----------- |
| 0 | normal |
| 1 | urgent |
Resulting in a drop-down like:
We want to test POSTs with highly configurable XML bodies, including a PIPE delimited payload of the following format:
<wctp-MessageText>{{type}}|{{message}}|{{facility}}|{{unit}}|{{room}}|{{bed}}|{{priority}}|{{phone}}|{{messageType}}</wctp-MessageText>
e.g.:
<wctp-MessageText>NurseCall|Code Blue|Hospital1|ICU|402|A|0|1004|message</wctp-MessageText>
The only free text variables are {{message}}
and {{phone}}
. All others have a pre-defined set of valid values. E.g. {{priority}}
can only be "0" (normal) or "1" (urgent); {{messageType}}
can only be "message" (show alert) or "clear" (remove alert).
While {{priority}}
is required, {{messageType}}
is optional and defaults to "message". Thus, we would want some kind of <blank>
option in the drop-down for {{messageType}}
.
I suppose you could have a header:
//mode:type1
//mode:type2
mode:Other Special Type
And then the pre-request script:
var modes = {
"type1" : {
"message" : "custom message for type1",
"phone" : "1234567890"
},
"type2" : {
....
},
...
};
var mode = modes[pm.variables.get('mode')];
for(var header in mode){
pm.variables.set(header, mode[header]);
}
But a built in UI feature for this would be ultimately better and more stable.
Is this feature coming anytime soon?
This feature would be helpful
I'd also be really happy if this was an option.
I'm voting up this feature request too. Looking at the original request date, I'm surprised it has not added already. I just want to pick the value for a my custom header key from a dropdown of possible values, instead of copy/paste every time.
@shamasis @vkaegis Could you please provide an update on this feature request? Thanks.
I would love this feature! really need this one;
it's been over 5 years, and the feature is still not there 🤔 we were looking for this feature.
where feature 😿
No solution yet. This is a basic but powerful feature, will save lot of typing. I am sure team postman can do a lot better here 👎
We use many X-Auth-Types and X-Identity-Types in preset headers. But as there are so many of them they take up a lot of screen space.
Would it be possible to have a drop-down for the values tab? We constantly have to deactivate and activate them.