postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.78k stars 837 forks source link

Dropdown for same key values [Feature] #4525

Open rvq opened 6 years ago

rvq commented 6 years ago

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.

dhineshwiz commented 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,

screen shot 2018-05-07 at 7 12 27 pm screen shot 2018-05-07 at 7 12 56 pm

please refer docs for more information, https://www.getpostman.com/docs/v5/postman/scripts/pre_request_scripts

science695 commented 6 years ago

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?

gekonwi commented 5 years ago

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:

Our Use Case

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}}.

science695 commented 5 years ago

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.

pramanikriju commented 4 years ago

Is this feature coming anytime soon?

vellala2000 commented 4 years ago

This feature would be helpful

jcmertz commented 3 years ago

I'd also be really happy if this was an option.

maroonedsia commented 3 years ago

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.

gianbianchi commented 1 year ago

I would love this feature! really need this one;

maard commented 8 months ago

it's been over 5 years, and the feature is still not there 🤔 we were looking for this feature.

cristiadu commented 2 weeks ago

where feature 😿

gunasekaran-sp commented 4 days ago

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 👎