Hi there!
In the documentation on Variables (https://octopus.com/docs/reference/variable-substitution-syntax) there is a part about array-object based variables:
Endpoint[A].Address http://a.example.com
Endpoint[A].Description Master
Endpoint[B].Address http://b.example.com
Endpoint[B].Description Slave
And how to use it in the substitution:
Listening on:
#{each endpoint in Endpoint}
- Endpoint #{endpoint} at #{endpoint.Address} is #{endpoint.Description}
#{/each}
I tried this and it didn’t work as described here. #{endpoint.Address} is not resolving. I had to use this:
#{Endpoint[#{endpoint}].Address}
Is there an error in the documentation or am I doing it wrong?
Thank you.
Serge
Hi Sergei, thanks for reaching out.
The example in the documentation is valid for the latest releases of Octopus Deploy. Which version of Octopus are you using locally? And how are the variables defined (i.e. step template parameters, project variables etc)?
You can debug variables by having them added to the log files using the instructions at https://octopus.com/docs/how-to/debug-problems-with-octopus-variables#DebugproblemswithOctopusvariables-Writethevariablestothedeploymentlog.
If you can attach the log file with the variables included that would help us to reproduce the issue.
Regards
Matt C
Yes. It works. It was a mistake on my end. I used it with something like this:
#{endpoint}.Address
Thank you for the prompt response.