Condition Based Service Dialogs

automate

#1

How can we make service dialogs visible based on previous selection.
E.g.: I am having drop down option for os_name , os_version.
If i will select os_name as Linux based on my selection it should show Linux version only in next down down of os_version.
If i will select os_name as Windows based on my selection it should show Windows version only in next down down of os_version.


#2

You can make the os_version dropdown dynamic.

os_name = $evm.root['dialog_os_name']
# Note that values is a hash: { "value1" => "This is label 1",  "value2" => "This is label 2" } 
values = os_name == 'linux' ? get_linux_versions() : get_windows_versions()
$evm.object['values'] = values 
$evm.object['visible'] = true/false

More Info here:
https://pemcg.gitbooks.io/mastering-automation-in-cloudforms-4-2-and-manage/content/service_dialogs/chapter.html