# Problem with check fields

**URL:** <https://community.silverfin.com/t/problem-with-check-fields/2019>\
**Category:** Templates\
**Created:** [February 11, 2021, 2:44pm UTC](https://community.silverfin.com/t/problem-with-check-fields/2019 "2021-02-11T14:44:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![svalais](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/svalais/32/2422_2.png) [@svalais](https://community.silverfin.com/u/svalais)\
**Post date:** [February 11, 2021, 2:44pm UTC](https://community.silverfin.com/t/problem-with-check-fields/2019/1 "2021-02-11T14:44:01Z")

</div>

Hello,

We have a problem with following code:

> Blockquote  
> {% stripnewlines %}  
> |

|  
|  
|  
[{% newline %}  
|  
] **_{% t “Compliance check” %}_**  
|]  
|] **{% t “Compliance Consultant/Manager - Confirmation” %}**  
|] **{% t “Compliance expert – Ready for client validation” %}**  
[{% newline %}  
|  
] **{% t “Accountancy aandachtspunten” %}** {% input period.custom.accreview.tax.file as:file %}  
|] **{% t “Reactie” %}**  
|]  
|]  
[{% newline %}{% assign $1 = 1 %}{% fori accreview in custom.accountancy\_review %}  
|] {{ $1 |integer }}. {% input accreview.vraag as:text placeholder:‘’%}  
|] {% ic %}{{ $1 |integer }}.{% endic %} {% input accreview.antwoord as:text placeholder:‘’%}  
|] {% ic %}{{ $1 |integer }}.{% endic %} {% ic %}{% input accreview.vraag\_check as:boolean %}{% endic %}{% if accreview.vraag\_check == true %}{{ accreview.vraag\_check.updated\_by.name }} {{ accreview.vraag\_check.updated\_at | date:“%d/%m/%Y” }}{% endif %}  
|] {% ic %}{{ $1 |integer }}.{% endic %} {% ic %}{% input accreview.antwoord\_check as:boolean %}{% endic %} {% if accreview.antwoord\_check == true %}{{ accreview.antwoord\_check.updated\_by.name }} {{ accreview.antwoord\_check.updated\_at | date:“%d/%m/%Y” }} {% endif %}  
[{% newline %}{% assign $1 = $1+1 %}{% endfori %}  
{% endstripnewlines %}

> Blockquote

When the checkbox for third column is checked and a user checked the checkbox in the fourth column, then the name and date of the third column is changed in the name and date of the fourth column.

Is it possible to have a quick look to this problem?

Thanks a lot,

Sylvie

---

<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:** [February 11, 2021, 4:01pm UTC](https://community.silverfin.com/t/problem-with-check-fields/2019/2 "2021-02-11T16:01:41Z")

</div>

Hi Sylvie,

This is a known challenge as from the technical point of view the `updated_by` and `updated_at` methods can only be call once per loop iteration, that means that the date and time will keep updating when you click the booleans (previous shown date/times are not kept in our database and that’s why the second column is being overwritten).

There is a workaround for this though. You can create a custom variable that does not belong to the collection of the loop itself but it’s linked to it indirectly with the key, for example: `custom.test.[accreview.key]`. This variable name will change dynamically because of the key but it doesn’t belong to the `custom.accountancy_review` collection so that you can keep two separate records for the dates.

Please see the below code as an example:

```auto
{% stripnewlines %}
|

|
|
|
[{% newline %}
|
] {% t “Compliance check” %}
|]
|] {% t “Compliance Consultant/Manager - Confirmation” %}
|] {% t “Compliance expert – Ready for client validation” %}
[{% newline %}
|
] {% t “Accountancy aandachtspunten” %} {% input period.custom.accreview.tax.file as:file %}
|] {% t “Reactie” %}
|]
|]
[{% newline %}{% assign $1 = 1 %}{% fori accreview in custom.accountancy_review %}
|] {{ $1 |integer }}. {% input accreview.vraag as:text placeholder:’’%}
|] {% ic %}{{ $1 |integer }}.{% endic %} {% input accreview.antwoord as:text placeholder:’’%}
|] {% ic %}{{ $1 |integer }}.{% endic %} {% ic %}{% input accreview.vraag_check as:boolean %}{% endic %}{% if accreview.vraag_check == true %}{{ accreview.vraag_check.updated_by.name }} {{ accreview.vraag_check.updated_at | date:"%d/%m/%Y" }}{% endif %}
|] {% ic %}{{ $1 |integer }}.{% endic %} {% ic %}{% input custom.test.[accreview.key] as:boolean %}{% endic %} {% if custom.test.[accreview.key] == true %}{{ custom.test.[accreview.key].updated_by.name }} {{ custom.test.[accreview.key].updated_at | date:"%d/%m/%Y" }} {% endif %}
[{% newline %}{% assign $1 = $1+1 %}{% endfori %}
{% endstripnewlines %}

```

Let us know if you have any questions.

Best,  
Borja

---

<div class="post-metadata">

**Author:** ![svalais](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/svalais/32/2422_2.png) [@svalais](https://community.silverfin.com/u/svalais)\
**Post date:** [February 12, 2021, 7:13am UTC](https://community.silverfin.com/t/problem-with-check-fields/2019/3 "2021-02-12T07:13:12Z")

</div>

Hi Borja,

Thanks for the answer but what happens with the already checked checkbox with this update?

Are the data lost?

Thanks a lot,

Sylvie

---

<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:** [February 12, 2021, 8:01am UTC](https://community.silverfin.com/t/problem-with-check-fields/2019/4 "2021-02-12T08:01:00Z")

</div>

> [@svalais](#):
>
> accreview.antwoord\_check

Hi Sylvie,

The data is not lost, it’s still stored in `accreview.antwoord_check` so you could perhaps show it as a default. Something like this:

`{% input custom.test.[accreview.key] as:boolean default:accreview.antwoord_check %}`

The only problem with the above is that the boolean might be ticked by default but you still have the issue regarding the date.

Best,  
Borja
