Get line from multiline variable value

Hi.
We have a multiline text variable like this:

is it possible to get only the first or second line from this variable like this:
#{IngressHostName[0]}
or
#{IngressHostName[1]}
?

Thank you.

Hi @drubtcov,

Thanks for getting in touch! Octopus doesn’t allow you to call the multi-line variables in such a way. If you could provide some further details about your requirements here, I may be able to provide a more informative answer.

Generally when using variables in Octopus, the best way to handle multiple values is by scoping individual values to different things. For example, if you have two hostnames, you can create a single normal variable called IngressHostName, then assign two separate values, which is different to a multiline variable. Each value can then be scoped to a different environment, machine, role, etc. Our documentation has a lot of further detailed information on this.

If this doesn’t help in your situation, you will need to provide some further details about what you need to achieve.

Let me know if this helps.

Best regards,
Daniel

Hi.
Thanks for your reply. I get it. The question can be considered closed.

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