SwanseaUni
Contributor
Contributor

Outputting the input of a drop down to form ?

Jump to solution

We are trying to output the value of a selected input (drop down list) to another input box (string) below it

E.g. there is a drop down list on the request form for a DEV/TEST/UAT box, so if i select UAT for example i want the next input box (which is the server name) to then be pre populated with what i choose in the drop down box ? eg UAT-XXXXXXXXX (where XXXXXXXX would be the servername the user could input)

is this even possible ?

Many thanks in advance

0 Kudos
1 Solution

Accepted Solutions
emacintosh
Enthusiast
Enthusiast

if i'm imagining the scenario correctly (maybe that's a big IF)...for that 3rd input, i would click on Values -> Default Value, then change it from constant to Computed Value, then choose concatenate as the operation and then you could add your prefix field, a constant of a "-" and then the vmname field.

Something like this (i just used project/deployment fields as an example)

emacintosh_0-1621016555224.png

 

View solution in original post

5 Replies
emacintosh
Enthusiast
Enthusiast

Do you need the user to actually see/interact with the UAT-<server name> or do you just need it in some input field?  In vRA 8.x, I believe you could have a 3rd field whose value is a combination of the env input, a constant of a "-" and the server name field.  So they would choose env, type in the server name and then this 3rd input, maybe read-only or hidden, could put those together.

Not sure if that's a viable option for you?

SwanseaUni
Contributor
Contributor

yes that would definitely be acceptable, we are having trouble echoing the selected input back out to the form though ? 

${input.prefix + input.vmname}

what syntax do i need to use to echo the value back out ?

0 Kudos
emacintosh
Enthusiast
Enthusiast

if i'm imagining the scenario correctly (maybe that's a big IF)...for that 3rd input, i would click on Values -> Default Value, then change it from constant to Computed Value, then choose concatenate as the operation and then you could add your prefix field, a constant of a "-" and then the vmname field.

Something like this (i just used project/deployment fields as an example)

emacintosh_0-1621016555224.png

 

View solution in original post

SwanseaUni
Contributor
Contributor

i will give it a go 😉

Thanks for all the advice

0 Kudos
SwanseaUni
Contributor
Contributor

That worked a treat ! 

Top man thanks for the advice i been banging my head for hours trying to do something so simple !