Table doesn't print

We created a table with a drop down menu. But when we export the document, the table isn’t shown.
how can I solve this.

this is the code:

{% comment %}------------------------- START: CONFIGURATION VARIABLES -------------------------{% endcomment %}
{% assign range_equity_accounts = range_equity_accounts | default:'618' %}
{% assign default_range_equity_accounts = default_range_equity_accounts | default:'618000' %}

{% assign accounts = period.accounts | range:custom.accounts.range %}
{% assign accounts = accounts.include_zeros %}

{% assign remuneration_directors = period.reconciliations.REMUNERATION_DIRECTORS %}

{% assign default_aantal_bezoldigdge_bestuurders = 0 as:integer %}

{% fori director in period.directors %}
{% if director.name != blank %}

  {% assign director_name = '' %}
  {% assign director_name = {{ director.name }} %}

  {% assign director_names_array = director_names_array | append:director.name %}
    {% unless forloop.last %}
      {% assign director_names_array = director_names_array | append:"|" %}
    {% endunless %}

{% assign default_aantal_bezoldigdge_bestuurders = default_aantal_bezoldigdge_bestuurders+1 %}

  {% assign firstname_lastname = "" %}
  {% assign names = "" %}
  {% fori person in period.people %}
  {% if person.custom.first_name != blank && person.custom.last_name != blank %}
    {% assign firstname_lastname = firstname_lastname | append:person.custom.first_name | append:" " | append:person.custom.last_name %}
      {% if firstname_lastname != director_name %}
        {% assign director_names_array = director_names_array | append:firstname_lastname %}
        {% unless forloop.last %}
          {% assign director_names_array = director_names_array | append:"|" %}
        {% endunless %}
      {% endif %}
    {% else %}
  
  {% endif %}
  
  {% endfori %}

{% endif %}
{% endfori %}


{% ic %}
Geef het aantal bezoldigde bestuurders{% input custom.value.bezoldigde_bestuurders assign:aantal_bezoldigde_bestuurders default:default_aantal_bezoldigdge_bestuurders %}
{% endic %}

{% comment %}
tabel
{% endcomment %}
{% capture tabel_bezoldiging %}

{% for i in (1..100) %}{% if i == aantal_bezoldigde_bestuurders+1 %}{% break %}
{% else %}
{% stripnewlines %}
| {% input custom.director.dropdown[i] as:select options:director_names_array assign:value_dropdown_bestuurders %}
| 
{% newline %}
| {% input custom.value_dropdown.bestuurders default:"bezoldigingen" %}
| 
{% newline %}
|--------
|----25%----+
{% newline %}
|{% input custom.accounts[i].range as:account_collection range:range_equity_accounts default:default_range_equity_accounts accounts_var:accounts%}{% assign accounts = accounts.include_zeros %}|{% for account in accounts %}{% newline %}|{% linkto account %}{{account.number}}{% endlinkto %} {{account.name}}|{% assign account_number = account.number | replace:".","_" %}{%=$2+input custom.value[account_number][i] assign:aantal_account_i default:account.value as:currency placeholder:"" %}
{% endfor %}|{% newline %}
|
{% newline %}
| Totaal {{ i }} {% if $2 != 0%} {% endif %}
| {% =$2- $2 %}
{% endstripnewlines %}
{% endif %}{% endfor %}
{% endcapture %}

{{ tabel_bezoldiging  }} 

Hi @Jessy!

Cool template you have there :+1:

There’s a part in your code where a variable is made only in input-mode, and that same variable of course needs to work in output mode as well. It’s this part:

{% ic %}
Geef het aantal bezoldigde bestuurders{% input custom.value.bezoldigde_bestuurders assign:aantal_bezoldigde_bestuurders default:default_aantal_bezoldigdge_bestuurders %}
{% endic %} 

The assign-attribute is between the IC-tags, meaning the var aantal_bezoldigde_bestuurders will not be made in export at all.

May I suggest the following:

Add infotext first, and don’t assign yet the variable:

{% ic %}{::infotext}
Geef het aantal bezoldigde bestuurders{% input custom.value.bezoldigde_bestuurders  %}
{:/infotext}{% endic %} 

(I’m a big fan of these infotexts, as they stand out as text that guides the user for something to do.

After this,

Create variable with default attribute:

{% comment %}create variable so correct table is exported{% endcomment %}
{% assign aantal_bezoldigde_bestuurders = custom.value.bezoldigde_bestuurders | default:default_aantal_bezoldigdge_bestuurders %} 

Looking at your old code, I don’t think I need to explain what this does. Let me know, if it’s not clear though.

So always be careful when using the assign attribute within IC-tags.
Personally, I’d like to create all variables on top of the template (of course, the assign attribute within an input-tag happens often as well, but there you always need to be mindful of the fact that the variable needs to be created outside the IC-tags.
As we use info texts a lot, we also don’t use it there, because of the IC-tags.)

Hope this helps, and apologies for the late reply.

Complete adapted code:

{% comment %}------------------------- START: CONFIGURATION VARIABLES -------------------------{% endcomment %}
{% assign range_equity_accounts = range_equity_accounts | default:'618' %}
{% assign default_range_equity_accounts = default_range_equity_accounts | default:'618000' %}

{% assign accounts = period.accounts | range:custom.accounts.range %}
{% assign accounts = accounts.include_zeros %}

{% assign remuneration_directors = period.reconciliations.REMUNERATION_DIRECTORS %}

{% assign default_aantal_bezoldigdge_bestuurders = 0 as:integer %}

{% fori director in period.directors %}
{% if director.name != blank %}

  {% assign director_name = '' %}
  {% assign director_name = {{ director.name }} %}

  {% assign director_names_array = director_names_array | append:director.name %}
    {% unless forloop.last %}
      {% assign director_names_array = director_names_array | append:"|" %}
    {% endunless %}

{% assign default_aantal_bezoldigdge_bestuurders = default_aantal_bezoldigdge_bestuurders+1 %}

  {% assign firstname_lastname = "" %}
  {% assign names = "" %}
  {% fori person in period.people %}
  {% if person.custom.first_name != blank && person.custom.last_name != blank %}
    {% assign firstname_lastname = firstname_lastname | append:person.custom.first_name | append:" " | append:person.custom.last_name %}
      {% if firstname_lastname != director_name %}
        {% assign director_names_array = director_names_array | append:firstname_lastname %}
        {% unless forloop.last %}
          {% assign director_names_array = director_names_array | append:"|" %}
        {% endunless %}
      {% endif %}
    {% else %}
  
  {% endif %}
  
  {% endfori %}

{% endif %}
{% endfori %}

{% comment %}create variable so correct table is exported{% endcomment %}
{% assign aantal_bezoldigde_bestuurders = custom.value.bezoldigde_bestuurders | default:default_aantal_bezoldigdge_bestuurders %}

{% ic %}{::infotext}
Geef het aantal bezoldigde bestuurders{% input custom.value.bezoldigde_bestuurders  %}
{:/infotext}

<p></p>
{% endic %}

{% comment %}
tabel
{% endcomment %}
{% capture tabel_bezoldiging %}

{% for i in (1..100) %}{% if i == aantal_bezoldigde_bestuurders+1 %}{% break %}
{% else %}
{% stripnewlines %}
| {% input custom.director.dropdown[i] as:select options:director_names_array assign:value_dropdown_bestuurders %}
| 
{% newline %}
| {% input custom.value_dropdown.bestuurders default:"bezoldigingen" %}
| 
{% newline %}
|--------
|----25%----+
{% newline %}
|{% input custom.accounts[i].range as:account_collection range:range_equity_accounts default:default_range_equity_accounts accounts_var:accounts%}{% assign accounts = accounts.include_zeros %}|{% for account in accounts %}{% newline %}|{% linkto account %}{{account.number}}{% endlinkto %} {{account.name}}|{% assign account_number = account.number | replace:".","_" %}{%=$2+input custom.value[account_number][i] assign:aantal_account_i default:account.value as:currency placeholder:"" %}
{% endfor %}|{% newline %}
|
{% newline %}
| Totaal {{ i }} {% if $2 != 0%} {% endif %}
| {% =$2- $2 %}
{% endstripnewlines %}
{% endif %}{% endfor %}
{% endcapture %}

{{ tabel_bezoldiging  }}  

Thanks! it works great!

Glad to help! :+1: