Dynamic Template Reference using Variables

I am attempting to make the reference to a reconciliation template dynamic so that we can copy a template that we use for multiple clients and one variable at the top of the reconciliation and have it update the references to templates throughout the reconciliation.

In the below example we are referencing the template “client_q”; however, I am looking to be able to assign a variable where {% assign client = client1 %} and therefore the reference will be to a different template “client1_q”.

{% assign general_q = period.reconciliations.client_q.custom.q %}

Would something like this be possible?

Hi @dgreenfield ,

Dynamic variables can be introduced if the know the reconciliation handle and name of the custom variable for each client upfront. The code could be like this:

{% assign client_recon = "client_recon_a" %}
{% assign client_custom = "client_custom_a" %}

{% assign general_q = period.reconciliations.[client_recon].custom.[client_custom] %}

Best regards,


Thank you Michiel!