Hi folks, i'm new to VCO, so please excuse a certain degree of ignorance as I'm still learning 🙂
So here's what I'm trying to achieve: A workflow with three fields
1) An application version (predefined array)
2) Name of a SQL Server (array of servernames retrieved from a sql query)
3) Name of a Database (array of databases retrieved from a sql query)
Then pass these to a powershell script to run.
Independently, these work. I can choose from the dropdowns and these are passed to my powershell script.
What I now would like, and am having difficulty with, is having the dropdown of #3 change based on the value selected from #2, because I want to constrain the user of the workflow to only the databases that exist on the specified SQL server.
I'm not quite sure how I can manage this though. how would I achieve this?
Thanks in advance.
Here's one way to do it which is pretty easy.
if (myInput == "" || myInput == null){
return ["Please select a value above."];}
if (myInput == "one"){
return [
"A",
"B",
"C"
];}
if (myInput == "two"){
return [
"D",
"E",
"F"
];}
if (myInput == "three"){
return [
"G",
"H",
"I"
];}
You create myInput as an input to the form and in JS based on myInput value you return a static list of results. Similarly with better formatting:
if (arg0 == null) {
return [];
}
if (arg0 == "a") {
return ["a1", "a2", "a3"];
}
return ["b1", "b2", "b3"];
Thanks, but unfortunately this doesn't address the dynamic nature of my requirement, as there isn't an IF here, there will always be a SQL server and there will always be databases on each SQL Server, my issue is not knowing how to change what's populated in the database dropdown when the database server dropdown changes.
Have you read my article here? https://www.vcoteam.info/articles/learn-vco/290-dynamic-input-values-based-on-other-inputs.html While that article deals with AD users, the technique is similar for anything else.
Hey @Burke, I tried to access the link you provided, but i get a 403 - access denied error, and the same on vcoteam.info.
I just used two different browsers from my home system and a 3rd different browser in a remote system on my corp network - in all cases, the link came up just fine...