Rollforward nil in For loop item with boolean

Hi,

How can I reset the checkbox for the next period?
The comments can stay in the next period.

For example:

Code:

Consistentiecheck

{% assign checklist_DETConsistentie_array = "Dubbele facturen|Relatiecontrole|Verkoopfacturen volledig|Consistent gebruik grootboekrekening en BTW codes|Bankverwerkingsregels geöptimaliseerd|BTW-nummers op verkoopfacturen steeds opgenomen?|MAR bijgewerkt|MAR % in orde gezet|Klantspecifieke opmerkingen bijgewerkt|Kwaliteitsmonitor bijgewerkt|Checklist backoffice Yuki doorlopen"|split:"|"%} {% assign keyDETConsistentie_array = "Zowel aan- als verkopen nagekeken?|Ongebruikte adressen wegwerken, zeker de 5 categoriën nagekeken?|Verkoopfacturen volledig?|Consistent gebruik nagekeken?|Foutieve regels gewist?|BTW-nummers opgenomen?|MAR bijgewerkt?|MAR% in orde?|Klantspecifieke opmerkingen nagekeken?|Kwaliteitsmonitor in orde?|Checklist backoffice Yuki in orde?" |split:"|" %}

{% stripnewlines %}
|
|
|
| Check
| Comment
{% newline %}
|----1%----
|----5%----

----1%----:
----50%----+

{% newline %}
{% assign no = 0 %}
{% for item in keyDETConsistentie_array %}
| {% if custom.checklist_boolean.[item] != true %}{% unreconciled 1 as: indicator unreconciled_text:“Obligated” %}{% endif %}
| {% input custom.checklist_boolean.[item] as:boolean %}
| {% assign no = no+1 %}
{{ no | integer }}.
| {{ checklist_DETConsistentie_array[forloop.index0] }}
| {% input custom.comment.[item] as:text default:item %}
{% newline %}
{% endfor %}
{% endstripnewlines %}

To reset the custom.checklist_boolean.[item] I wanted to use this code, but it doesn’t work:
{% rollforward nil custom.checklist_boolean.[item] %}

What should I do to make the code work?

Hi @EHE1

I assume you’re building this template as a text template instead of a reconciliation?
In text templates, inputs are by default period-independent, or in other words, they’re not linked to the PeriodDrop.

So by default any change you make to the booleans or text inputs, will be changed in all periods (in future AND past periods).

If you want to make an input period-dependent inside a text template, you need to link it to the PeriodDrop:

{% input period.custom.checklist_boolean.[item] as:boolean %}

If you then want to copy these details to another period, you’ll need to use the ‘copy template data’ option from the homescreen:

I would also suggest to not link the keys of your inputs to the strings you’re using as a default, because this will make it harder to not lose data if you would ever need to update a specific piece of text in your array.

I hope this helps you further!

Kind regards
Wouter

Hi Wouter,

Thanks for your reply. But it is not a text template.

For other boolean input fields the code works perfectly:
For example:
{% rollforward nil custom.LonenManueel.boolean %}

When I want to copy these details I can see this:
image

The ‘!’ is there because I’m testing :wink:

So the period isn’t required? Or is it because of the ‘for’ loop?

In case of a reconciliation, the nil rollforward should be working to reset the value of the booleans.
However, I don’t see any rollforward in your snippet shared above, maybe you’re placing the rollforward outside of the for-loop?

When I test with the rollforward inside the loop then it’s working:

{% for item in keyDETConsistentie_array %}
| {% if custom.checklist_boolean.[item] != true %}{% unreconciled 1 as: indicator unreconciled_text:“Obligated” %}{% endif %}
| {% input custom.checklist_boolean.[item] as:boolean %}
| {% assign no = no+1 %}
{{ no | integer }}.
| {{ checklist_DETConsistentie_array[forloop.index0] }}
| {% input custom.comment.[item] as:text default:item %}
{% newline %}

{% rollforward nil custom.checklist_boolean.[item] %}
{% endfor %}
1 Like