Can the {% for variable in Variables %} help for % and $ expansion in one go?

Could this help solving the expansion of both % and $ expressions in one go?

{% for variable in Variables %}
    {% if variable.Name == ‘MyAwesomeBuildVariable’ and variable.Value != ‘’ %}
        My Awesome Build Variable: {{ variable.Value }}
    {% endif %}
{% endfor %}

See https://plus.google.com/+JeroenPluimers/posts/9WVFCkKD6wq

<<
Wish: expansion of both $$ and %% in the same string.

To circumvent this error (where %TargetVersion%=XE2):

Could not expand query ‘$Agent.Delphi.%TargetVersion%.Path$’. Object reference not set to an instance of an object.

This might be a much simpeler solution: create two new “misc” actions:
- assign variable expand $$
- assign variable expand %%
That way the action flow can determine what do do in which order and ensure the two-stage expansion is done correctly.
Alternatively, you could make the “expansion” a 5-state one:
- no expansion
- $$ expansion
- %% expansion
- %% followed by $$ expansion
- $$ followed by %% expansion
(from what I observe, I think the final state is what is currently used)
>>

Hi Jeroen,

I’m not sure exactly what you are asking here?

The expression:

 {% for variable in Variables %}

    {% if variable.Name == ‘MyAwesomeBuildVariable’ and variable.Value != ‘’ %}
        My Awesome Build Variable: {{ variable.Value }}
    {% endif %}
{% endfor %}

is valid for use in notification templates to get the value of a variable. 

The expression $Agent.Delphi.%TargetVersion%.Path$’ does not currently work. We need to do some work on our expression parser to make this work - it’s on our to-do list…