Using Inputs To Set Other Inputs in Morpheus

An interesting question came up with how to use one input to define multiple other inputs. It was a little more complex than I initially thought, but there were a couple of solutions to the problem.

One was to define many values in the first option list dataset:

production,stable|1.4
dev,develop|2.0

To get one of the subvalues, use something like this to split on the |:

customOptions.clustername.tokenize('|')[0]

Depending on the complexity and number of values you need, you may want to define separate inputs for the other values. Since that is a longer topic requiring screenshots, I posted it to my blog here.

3 Likes

Nice! I use this trick all of the time for things like selecting a layout. Sometimes I want the layout id, code, and version so I can map 1 selection to multiple locations within the Service Catalog spec. Tokenize delimiting on a ‘|’ allows me to do this. (I even do the same with dependent/waterfalling drop downs!)

I love this trick. Like @cbunge I use it whenever I need to handle multiple values from a single input.

1 Like