Closed giseliramos closed 3 months ago
Hi @giseliramos, because these are runtime pipeline variables, you can't use YAML template syntax (which is compile-time) with them. More info about runtime(+macro) and compile variables and differences between them shared in this doc
Could you clarify your use case with more details? Probably we'll be able to find a suitable solution for you
Hello @KonstantinTyukalov, the scenario I have:
##vso[task.setvariable variable=$SourceAcr1;isOutput=true]$source1
$SourceAcr1
, $SourceAcr2
in one run and in another run have 1 or 3, for example. That is why I tried the json to use to iterate between the keys.AcrOrigin1: $[ stageDependencies.Stage1.Job1.outputs['TaskName.SourceAcr1'] ]
. The problem is that I want to avoid hard-coding it, like as sourceAcr1, sourceAcr2. So I need to estimate a max number, like, max 5 variables and check for each (hard-coded) if they are not empty in the "condition" of job/task.
numberPopulated
and try to loop. It is possible to use this information and loop, like as in:
copy the numberPopulated to variables and expand as in a array, from 1 to numberPopulated
Is that possible? Or I'll need to hard-copy and check for each variable? For now, I'm doing the following for each variable, but it is cumbersome:
Such questions should be posted on the Developer Community, since this repo is mainly about the templates located in this repository.
Hello,
I have a powershell script in a stage that creates a jsonObject and I save it to a variable to be reused later:
This part works okay. The matter is that I want to populate some YAML variables with it or iterate, for example, I want to iterate for each "dict" here and extract the info. Is that possible to do in the YAML, to populate on variables or on parameters template?
Thanks!