Conditional Variable in Inapp Pool Field

Is there a way to use a conditional variable for the app pool name int the IIS Website template.

Something like this :

Hi @Steve_Westner,

Thanks for getting in touch! Octopus does have a conditional variable syntax which can be used here, however it does not include #{else}.

The following documentation page has detailed information on what is available in our Variable Substitution Syntax and how you can use it.

Let me know if the documentation helps you achieve what you are after here. If not, let me know and I’ll do my best to help . :slight_smile:

Looking forward to hearing from you.

Best regards,
Daniel

Hey Daniel,

I was under the impression the #{else} was added in March? Has it not been released yet?


Also, removing the else, and instead chaining the if’s together, it seems that the inner values are replaced, but the if statement is not evaluated. For example

It makes it seems as though if statements are not evaluated if within a step template field

HI Steve,

Thanks for getting back here! Well it looks like we need to update our documentation to include some examples for #{else}!

As for your problem. Looking at the snippet you have attached, it seems that your IF statements may not be closed off.

I added the / to the final if and this worked as expected.
#{if siteName}#{siteName}#{else}#{siteHost}#{/if}

I tested this on my VM and it can confirm this work. So it looks like in your initial question, you were a / away from having this working, before I introduced some extra confusion. :slight_smile:

Does this help? If you are still stuck let me know.

Best regards,
Daniel

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