Calling a capture into code {% input [capture] %}

Hi @jhanley,

Nice what you’re going for. I’ve made some changes though:

{% stripnewlines %}
{% assign array_management = "Accounting Solutions|Accounting Systems Advice|Bookkeeping|Budgets and Forecasts|Consultancy and Advice|Company Secretarial|Management accounts|VAT returns" | split:"|" %}
{% assign array_years = "2018|2019|2020|2021|2022|2023|2024|2025|2026|2027|2028|2029|2030|2031|2032" | split:"|" %}

{::font size="l"}**CCH Actual Data**{:/font}
{% newline %}{% newline %}
|
{% for year in array_years %}
  |{{ year }}
{% endfor %}

{% newline %}
|-10%-
{% for year in array_years %}
|-6%-
{% endfor %}
#

{% newline %}
{% for service in array_management %}
|{{ array_management[forloop.index0] }}
 {% assign management = array_management[forloop.index0] %} 
 {% for year in array_years %}
   {% capture cell_name %}{{ management }}_{{ year }}{% endcapture %} 
    
   |{% input custom.some.[cell_name] placeholder:cell_name %}
 {% endfor %}
{% newline %}|{% newline %}

{% endfor %}
{% endstripnewlines %} 

So,

{% for year in array_years %}
|{{ year }}
{% endfor %}

There’s no need to go through your array with the forloop.index; if you use just {{ year }} it will do. (or whatever name you choses in your forloop)

{% for year in array_years %}

Same here.

{% capture cell_name %}{{ management }}_{{ year }}{% endcapture %}

Nice what you are doing here: creating a dynamic variable that will be different for every input object!
More info here:

{% input custom.some.[cell_name] placeholder:cell_name %}

The placeholder… Personally, I wouldn’t use it and use a general one. But never mind that.
Also, I don’t see the reason to make it a custom database variable in the company-drop. That would mean each input, no matter what year or category, is the same.

What I think you are trying to do, is make each input-object separate from each other, within the category and year. And you could use the dynamic variable for that:

custom.some.[cell_name] will be custom.some.Accounting Solutions_2019 & custom.some.Accounting Solutions_2020 and so on…

No? Let me know if this work for you.