Pull-down variables access to "name" value
![]()
Hello guys,
as pull-down variables are composed of "name - value" pairs values, I would like to access in a project step, not only the value chosen but also the name it corresponds to. I try to explain it better, I have defined an environment "pull-down" variable called "DESTENV" and defined some values as follows: DES - Development PRO - Production ... In a project step if I refer to $DESTENV I get the value: "Development", "Production" ... In this scenario, is there any way I can access the "name" value emulating the behaviour of a hash and its access to the key values? Thanks! Regards, Jorge. |
2 answers
![]() Hello guys, Hi Jorge, I can't think of anything that will allow you to do exactly what you would like. You could use the Services Layer API to get at the information, but I think that may be a little more involved than what you are looking for. Have you considered using another environment variable pull-down that would be the reverse of the existing one. Another option that you might consider is to use a Conditional step type to query the value of ${DESTENV} and set another variable based off that value. For example, the condition could be 'true(${DESTENV} eq Development)' and if that is true to set a variable DESTENV_DIR (.bset env "DESTENV_DIR=DEV"). You would need to do something similar for all of the possible values of DESTENV. bju |
![]()
Hi Brent,
actually that were the workarounds I already thought of. The problems I see are: 1. Another pull-down variable: this is my current implementation. Problem is pull-down vbles always have a default value, which can lead to user to just pay attention to one of them. 2. Conditional step type: this approach can lead to have several dummies conditional steps (currently 3). Very ugly solution mostly if the pulldown values grow. Anyway, thanks a lot for the tips. Don't hesitate to suggest any other possibilities you may think of :) Regards, Jorge. |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.