# No input-field in forloop

**URL:** <https://community.silverfin.com/t/no-input-field-in-forloop/2305>\
**Category:** Templates\
**Created:** [June 10, 2022, 10:32am UTC](https://community.silverfin.com/t/no-input-field-in-forloop/2305 "2022-06-10T10:32:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Loic\_Cogels](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@Loic\_Cogels](https://community.silverfin.com/u/Loic_Cogels)\
**Post date:** [June 10, 2022, 10:32am UTC](https://community.silverfin.com/t/no-input-field-in-forloop/2305/1 "2022-06-10T10:32:43Z")

</div>

Hi,

This is the code I wrote:  
{% input custom.range.rekeningen\_1 as:account\_collection range:“6” accounts\_var:rekeningen\_1 %}

{% stripnewlines %}  
| Rekeningnummer  
| Rekeningnaam  
| Bedrag  
|  
| {% input custom.naam.persoon\_1 placeholder:“Naam” assign:persoon\_1 %}  
| {% input custom.naam.persoon\_2 placeholder:“Naam” assign:persoon\_2 %}  
| {% input custom.naam.persoon\_3 placeholder:“Naam” assign:persoon\_3 %}  
|  
{% newline %}

| -------- |
| --- |
| -------- |
| ----3%---- |
| -------- |
| -------- |
| -------- |
| ----3%---- |

{% for rekening\_1 in rekeningen\_1 %}  
{% newline %}  
| {{ rekening\_1.number }}  
| {{ rekening\_1.name }}  
| {{ rekening\_1.value | currency }}  
|  
| {% input rekening\_1.percentage\_persoon\_1 as:percentage placeholder:“percentage” assign:rekening\_1\_percentage\_persoon\_1 %}  
| {% input rekening\_1.percentage\_persoon\_2 as:percentage placeholder:“percentage” assign:rekening\_1\_percentage\_persoon\_2 %}  
| {% input rekening\_1.percentage\_persoon\_3 as:percentage placeholder:“percentage” assign:rekening\_1\_percentage\_persoon\_3 %}  
| {% assign rekening\_1\_totaal\_percentage = rekening\_1\_percentage\_persoon\_1+rekening\_1\_percentage\_persoon\_2+rekening\_1\_percentage\_persoon\_3 %}  
{% if rekening\_1\_totaal\_percentage !=-1 %}  
{% unreconciled rekening\_1\_totaal\_percentage as:indicator %}  
{% endif %}  
{% endfor %}  
{% fori rekening\_2 in custom.rekeningen\_2 %}  
{% newline %}  
|  
| {% input rekening\_2.omschrijving %}  
| {% input rekening\_2.bedrag as:currency%}  
|  
| {% input rekening\_2.percentage\_persoon\_1 as:percentage placeholder:“percentage” assign:rekening\_2\_percentage\_persoon\_1 %}  
| {% input rekening\_2.percentage\_persoon\_2 as:percentage placeholder:“percentage” assign:rekening\_2\_percentage\_persoon\_2 %}  
| {% input rekening\_2.percentage\_persoon\_3 as:percentage placeholder:“percentage” assign:rekening\_2\_percentage\_persoon\_3 %}  
| {% assign rekening\_2\_totaal\_percentage = rekening\_2\_percentage\_persoon\_1+rekening\_2\_percentage\_persoon\_2+rekening\_2\_percentage\_persoon\_3-1 %}  
{% if rekening\_2\_totaal\_percentage !=-1 %}  
{% unreconciled rekening\_2\_totaal\_percentage as:indicator %}  
{% endif %}  
{% endfori %}  
{% endstripnewlines %}

  

{% stripnewlines %}  
| Omschrijving  
| Totaal  
| {{ persoon\_1 }}  
| {{ persoon\_2 }}  
| {{ persoon\_3 }}  
{% newline %}  
|--------+  
|----15%----  
|----15%----  
|----15%----  
|----15%----  
{% for rekening\_1 in rekeningen\_1 %}  
{% newline %}  
| {{ rekening\_1.name }}  
| {{ rekening\_1.value | currency }}  
| {% assign rekening\_1\_persoon\_1 = rekening\_1.value_rekening\_1\_percentage\_persoon\_1 %}{{ rekening\_1\_persoon\_1 | currency }} {% $1+ rekening\_1\_persoon\_1 %}  
| {% assign rekening\_1\_persoon\_2 = rekening\_1.value_rekening\_1\_percentage\_persoon\_2 %}{{ rekening\_1\_persoon\_2 | currency }} {% $3+ rekening\_1\_persoon\_2 %}  
| {% assign rekening\_1\_persoon\_3 = rekening\_1.value_rekening\_1\_percentage\_persoon\_3 %}{{ rekening\_1\_persoon\_3 | currency }} {% $5+ rekening\_1\_persoon\_3 %}  
{% endfor %}  
{% for rekening\_2 in custom.rekeningen\_2 %}  
{% newline %}  
| {{ rekening\_2.omschrijving }}  
| {{ rekening\_2.bedrag | currency }}  
| {% assign rekening\_2\_persoon\_1 = rekening\_2.bedrag_rekening\_2.percentage\_persoon\_1 %}{{ rekening\_2\_persoon\_1 | currency }} {% $2+ rekening\_2\_persoon\_1 %}  
| {% assign rekening\_2\_persoon\_2 = rekening\_2.bedrag_rekening\_2.percentage\_persoon\_2 %}{{ rekening\_2\_persoon\_2 | currency }} {% $4+ rekening\_2\_persoon\_2 %}  
| {% assign rekening\_2\_persoon\_3 = rekening\_2.bedrag_rekening\_2.percentage\_persoon\_3 %}{{ rekening\_2\_persoon\_3 | currency }} {% $6+ rekening\_2\_persoon\_3 %}  
{% endfor %}  
{% newline %}  
| Totaal per persoon:  
|  
| {% assign totaal\_persoon\_1 = $1+$2 %}{{ totaal\_persoon\_1 | currency }}  
| {% assign totaal\_persoon\_2 = $3+$4 %}{{ totaal\_persoon\_2 | currency }}  
| {% assign totaal\_persoon\_3 = $5+$6 %}{{ totaal\_persoon\_3 | currency }}  
{% endstripnewlines %}

I don’t get the input-fields on the first forloop from line 21 till 34. How can I solve this problem?

Kind regards,  
Loïc

---

<div class="post-metadata">

**Author:** ![Michiel](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/michiel/32/2364_2.png) [@Michiel](https://community.silverfin.com/u/Michiel)\
**Post date:** [June 10, 2022, 1:39pm UTC](https://community.silverfin.com/t/no-input-field-in-forloop/2305/3 "2022-06-10T13:39:30Z")

</div>

Hi @Loic_Cogels ,

When looping over the accounts\_var, you’re actual looping over accounts, which means in each iteration rekening\_1 is a specific account of that collection.

If you want to add input fields related to this account, you will need to add the custom drop (see [here](https://developer.silverfin.com/docs/account)). After updating your code it can look like this:

```auto
...
{% for rekening_1 in rekeningen_1 %}
  ...
  | {% input rekening_1.custom.percentage_persoon_1 as:percentage placeholder:“percentage” assign:rekening_1_percentage_persoon_1 %}
  | {% input rekening_1.custom.percentage_persoon_2 as:percentage placeholder:“percentage” assign:rekening_1_percentage_persoon_2 %}
  ...
{% endfor %}

```

I hope this clarifies your question.

Kind regards,  
Michil

---

<div class="post-metadata">

**Author:** ![Loic\_Cogels](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@Loic\_Cogels](https://community.silverfin.com/u/Loic_Cogels)\
**Post date:** [June 13, 2022, 6:13am UTC](https://community.silverfin.com/t/no-input-field-in-forloop/2305/4 "2022-06-13T06:13:58Z")

</div>

@Michiel when doing so I get the following liquid error:

- Liquid error: Custom values must have a key “rekening\_1.custom.percentage\_persoon\_1” in code: `input rekening_1.custom.percentage_persoon_1 as:percentage placeholder:"percentage" assign:rekening_1_percentage_persoon_1`
- Liquid error: Custom values must have a key “rekening\_1.custom.percentage\_persoon\_2” in code: `input rekening_1.custom.percentage_persoon_2 as:percentage placeholder:"percentage" assign:rekening_1_percentage_persoon_2`
- Liquid error: Custom values must have a key “rekening\_1.custom.percentage\_persoon\_3” in code: `input rekening_1.custom.percentage_persoon_3 as:percentage placeholder:"percentage" assign:rekening_1_percentage_persoon_3`

---

<div class="post-metadata">

**Author:** ![Michiel](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/michiel/32/2364_2.png) [@Michiel](https://community.silverfin.com/u/Michiel)\
**Post date:** [June 13, 2022, 6:52am UTC](https://community.silverfin.com/t/no-input-field-in-forloop/2305/5 "2022-06-13T06:52:28Z")

</div>

Oh sorry @Loic_Cogels !

A custom variable indeed always has a namespace and a key, so the variables above are missing one level. A possible solution here is to add a dot inbetween percentage and persoon.

```auto
...
{% for rekening_1 in rekeningen_1 %}
  ...
  | {% input rekening_1.custom.percentage.persoon_1 as:percentage placeholder:“percentage” assign:rekening_1_percentage_persoon_1 %}
  | {% input rekening_1.custom.percentage.persoon_2 as:percentage placeholder:“percentage” assign:rekening_1_percentage_persoon_2 %}
  ...
{% endfor %}

```

KInd regards,

Michiel
