# Liquid error: undefined method \[\]' for true

**URL:** <https://community.silverfin.com/t/liquid-error-undefined-method-for-true/1631>\
**Category:** Templates\
**Created:** [December 19, 2019, 1:55pm UTC](https://community.silverfin.com/t/liquid-error-undefined-method-for-true/1631 "2019-12-19T13:55:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@Peter](https://community.silverfin.com/u/Peter)\
**Post date:** [December 19, 2019, 1:55pm UTC](https://community.silverfin.com/t/liquid-error-undefined-method-for-true/1631/1 "2019-12-19T13:55:32Z")

</div>

Hi, i get the liquid error “Liquid error: undefined method []’ for true:TrueClass|Liquid error: undefined method []’ for true:TrueClass” inside a table and I don’t know where this came from. Anyone an idea?

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/2X/5/5f788e84f6988b84d5b7793febf71adbecceaf26.png)

`````auto
|Uitleg | Bedrag {% newline %}
|-------------|---15%------:+{% newline %}{% fori uv in custom.voorz_tabel %}
|{% input uv.text as:text size:mini %}|{% input uv.value as:currency %}{% newline %}{% endfori %}
{% endstripnewlines %}````
`````

---

<div class="post-metadata">

**Author:** ![borjaGonzalez](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/borjagonzalez/32/825_2.png) [@borjaGonzalez](https://community.silverfin.com/u/borjaGonzalez)\
**Post date:** [December 19, 2019, 2:18pm UTC](https://community.silverfin.com/t/liquid-error-undefined-method-for-true/1631/2 "2019-12-19T14:18:55Z")

</div>

> [@Peter](#):
>
> | Bedrag {% newline %} |-------------|—15%------:+{% newline %}{% fori uv in custom.voorz\_tabel %} |{% input uv.text as:text size:mini %}|{% input uv.value as:currency %}{% newline %}{% endfori %}

Hi Peter,

Could you please share the rest of the code? I don’t see any issues on that section.

Best,  
Borja

---

<div class="post-metadata">

**Author:** ![Peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@Peter](https://community.silverfin.com/u/Peter)\
**Post date:** [December 19, 2019, 2:41pm UTC](https://community.silverfin.com/t/liquid-error-undefined-method-for-true/1631/3 "2019-12-19T14:41:17Z")

</div>

```auto

<!-- Translations -->

{% t= "Overzicht van de voorzieningen" fr:"Aperçu des provisions" %}
{% t= "Andere" fr:"Autres" %}
{% t= "Voorzieningen voor risico's en kosten" fr:"Provision pour risques et charges" en:"Provisions for risks and charges" %}

<!-- LOCALE -->
{% assign locales_string = "nl|fr|en" %}
{% assign locales = locales_string | split:"|" %}
{% capture forced_locale %}{% if company.custom.select.language == blank %}{{ locale }}{% else %}{{ company.custom.select.language }}{% endif %}{% endcapture %}

{% ic %}

|--------------------:+
|{% input company.custom.select.language as:select options:locales_string %}{% endic %}

<!-- END LOCALE -->

{% locale forced_locale %}

<!-- deel ACC -->

# Accountancy

<!-- VOORZIENINGEN -->
{% input custom.voorz_tabel.show as:boolean %} **{% t "Overzicht van de voorzieningen" %}**

{% capture input_voorz_tabel_nl %}

{% stripnewlines %}
|Uitleg | Bedrag {% newline %}
|-------------|---15%------:+{% newline %}{% fori uv in custom.voorz_tabel %}
|{% input uv.text as:text size:mini %}|{% input uv.value as:currency %}{% newline %}{% endfori %}
{% endstripnewlines %}

{% endcapture %}

{% capture input_voorz_tabel_fr %}

|Explication | Montant
|-------------|---15%------:+{% fori uv in custom.voorz_tabel %}
|{% input uv.text as:text size:mini %}|{% input uv.value as:currency %}{% endfori %}

{% endcapture %}

{% assign voorz_tabel_var = "input_voorz_tabel_" | append:company.custom.select.language %}

{{ [voorz_tabel_var] }}

{% capture voorz_tabel_nl %}

|Uitleg | Bedrag
|-------------|---15%------:+{% for uv in custom.voorz_tabel %}
|{{ uv.text }}|{{ uv.value | currency }}{% endfor %}

{% endcapture %}

{% capture voorz_tabel_fr %}

|Explication | Montant
|-------------|---15%------:+{% for uv in custom.voorz_tabel %}
|{{ uv.text }}|{{ uv.value | currency }}{% endfor %}

{% endcapture %}

{% result "input_voorz_tabel_nl" input_voorz_tabel_nl %}
{% result "voorz_tabel_nl" voorz_tabel_nl %}
{% result "input_voorz_tabel_fr" input_voorz_tabel_fr %}
{% result "voorz_tabel_fr" voorz_tabel_fr %}
<!-- end VOORZIENINGEN -->

<!-- ANDERE -->
{% assign key_title = "title" | append:company.custom.select.language %}
{% assign key_text = "text" | append:company.custom.select.language %}

{% input custom.acc_andere.show as:boolean %} **{% input custom.acc_andere[key_title] default:"Andere" %}**

{% capture input_text_acc_andere_nl %}{% input custom.acc_andere.text_nl as:text size:mini %}{% endcapture %}
{% capture input_text_acc_andere_fr %}{% input custom.acc_andere.text_fr as:text size:mini %}{% endcapture %}

{% assign text_acc_andere_var = "input_text_acc_andere_" | append:company.custom.select.language %}

{{ [text_acc_andere_var] }}

{% result "input_text_acc_andere_nl" input_text_acc_andere_nl %}
{% result "text_acc_andere_nl" custom.acc_andere.text_nl %}
{% result "input_text_acc_andere_fr" input_text_acc_andere_fr %}
{% result "text_acc_andere_fr" custom.acc_andere.text_fr %}
<!-- END ANDERE -->

```

I also don’t see the problem, the error appears between the titel and the first input row. The template was created a long time ago with no problems and now this appears.

---

<div class="post-metadata">

**Author:** ![borjaGonzalez](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/borjagonzalez/32/825_2.png) [@borjaGonzalez](https://community.silverfin.com/u/borjaGonzalez)\
**Post date:** [December 19, 2019, 3:03pm UTC](https://community.silverfin.com/t/liquid-error-undefined-method-for-true/1631/4 "2019-12-19T15:03:16Z")

</div>

Hi again Peter,

It seems like you are using the namespace (custom.voorz\_tabel) on both your variables and foriloop. Try changing both of them and the error should dissapear. For example:

`{% input custom.section.show as:boolean %}` & ` {% fori uv in custom.my_collection %}`

instead of

`{% input custom.voorz_tabel.show as:boolean %}`` & `` {% fori uv in custom.voorz_tabel %}`

You can try just changing one but make sure you delete the previous entered information as it might still cause issues on the database.

Best,  
Borja

---

<div class="post-metadata">

**Author:** ![Peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@Peter](https://community.silverfin.com/u/Peter)\
**Post date:** [December 19, 2019, 3:29pm UTC](https://community.silverfin.com/t/liquid-error-undefined-method-for-true/1631/5 "2019-12-19T15:29:47Z")

</div>

Thanks Borja, It’s OK now in the company I tested, but I don’t know why this problems accurs now, since this template is more than a year old.  
Wouldn’t there be a problem now in other companies because they have used always the ‘old boolean’ variable?

---

<div class="post-metadata">

**Author:** ![borjaGonzalez](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/borjagonzalez/32/825_2.png) [@borjaGonzalez](https://community.silverfin.com/u/borjaGonzalez)\
**Post date:** [December 19, 2019, 3:47pm UTC](https://community.silverfin.com/t/liquid-error-undefined-method-for-true/1631/6 "2019-12-19T15:47:04Z")

</div>

Hi Peter,

That’s strange indeed, maybe no data was entered before for that specific template? Do you remember if you updated anything else just before you noticed the liquid error?

Best,  
Borja

---

<div class="post-metadata">

**Author:** ![Peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@Peter](https://community.silverfin.com/u/Peter)\
**Post date:** [December 19, 2019, 3:51pm UTC](https://community.silverfin.com/t/liquid-error-undefined-method-for-true/1631/7 "2019-12-19T15:51:01Z")

</div>

Hi Borja

No, it was a colleague of my that use this template. Maybe last year it was not used.  
Anyway, many thanks

Peter
