VMware Cloud Community
mastefani
Enthusiast
Enthusiast

Conditions in Blueprint Code

New to vRA8 and still learning the syntax for blueprint as code.  The code below takes the input of the OS from the users and changes the customization spec to be used based on that input.  That works great when you only have two OS' to pick from.  But how do I modify something like that to work with more than two OS?  It seems like conditions can only be A or B based on match.  Is there a way to rework that to work for multiple OS choices?

customizationSpec: ${input.OS,"Windows 2016")? "Win2016" : "Win2019"}

0 Kudos
2 Replies
rkhoo
VMware Employee
VMware Employee

You can do it the nested way.

customizationSpec: '${input.OS == "Windows 2016" ? "Win2016" : (input.OS == "Windows 2019" ? "Win2019" : "Ubuntu1804")}'

mastefani
Enthusiast
Enthusiast

Thanks, that's exactly what I was looking for.  Didn't realize you could nest the statements like that. 

0 Kudos