Conditional Variable Logic

Hey!

We have a set of variables all relating to SMB parameters for a deploy. There’s a checkbox to enable SMB, and then a host of things like a username, password, sharename, etc. Is it possible to add some conditional logic that if the checkbox for enable SMB is checked, the related variables become required? If my explanation doesn’t make sense I can try and elaborate further.

Thanks!
Jeff

Hi Jeff,

Thanks for reaching out.

Unfortunately, we can’t change fields to be required within the portal.

You could however halt the deployment in a few ways if the variable doesnt exist. The simplest method would be if the variables are static, you could have a required script step at the beginning of the deployment that has logic in it that checks to see if the variable is filled in and correct, and if it isnt it Write-Error’s that the variable needs to be filled. You could also use prompted variables in a first step as well.

There are some other ways we could do this but it all depends on your use case.

Do you think that would be something that could work for you?

Thanks,
Jeremy

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.