Creating global functions by means of 'capture', but with local variables

Good morning gentlemen,

A question with regard to the following scripts:

I’ve got the following script in a reconciliation template ‘Testje’:

{% capture Test %}hallo{% endcapture %}

{% result 'Test' Test %}

{% capture str_Paragraaf1 %}
  {{int_Parameter1}}
{% endcapture %}

{% result 'str_Paragraaf1' str_Paragraaf1 %}

I’ve also got the following script in a text template:

{% assign TestLokaal = period.reconciliations.Testje.results.Test %}
{% assign str_Paragraaf1Lokaal = period.reconciliations.Testje.results.str_Paragraaf1 %}

variabele {{TestLokaal}}

{% assign int_Parameter1 = 5 %}

str_Paragraaf1: {{str_Paragraaf1Lokaal | plus:1}}

Now, 'variabele {{TestLokaal}} gives me the expected output (being ‘variabele hallo’). I’d like to get my second function to give me ‘6’, being 5 defined by int_Parameter1 in the text template but referenced in the reconciliation template (this last bit is very important, as I’d like to get more and more of my functions in a reconciliation template (by means of ‘capture’) so I’d only have to define them once and reuse them every time with local variables.

However, the result is 1 as he does not find a value ‘int_Parameter1’ in the reconciliation template.

Is there another/better way to do this?

Thanks!

Hi Bart

the reuse which you are referring too, is not possible at the moment. However, this function will be foreseen in the future, although we can not put an exact timing on it.

Kind regards
Sofie

Hi Sofie,

Thank you for the response.

Could you keep me informed when this way of working is available (or if you have an alternative)?

Have a great day,

Bart Verhaeghe

analyse & rapportering