Timestamp in the fori loop

Hi,
I’m creating fori loop with attachment and timestamp in it. When the first attachment is attached and timestamp is added, a new line appears with the option to upload a new attachment and the timestamp information is copied from the above line.
I need the timestamp in the new line to be independent from the previous line.
(| {% input custom.check.1_1 as:boolean %} has to change 1_1 in every line).
How can it be done?

{% fori attachement in custom.attachements_1_1 %}
| {% input attachement.file as:file %}
| {% input attachement.description placeholder:“Description” %}
| {% input custom.check.1_1 as:boolean %}
| {{ custom.check.1_1.updated_by.name }}
| {{ custom.check.1_1.updated_at | date:"%d/%m/%Y %H:%M" }}
|{% newline %}
{% endfori %}

Thanks,

Hi Ugis,

I assume that custom.check.1_1.updated_by.name is done somewhere else in your code?

The reason for this is because your forloop only checks for attachments in custom.attachments.
To solve this you’ll have to add updated_by in the same collection --> custom.attachments.1_1.updated_by.name instead of custom.check.1_1.updated_by.name

This way your forloop will not use the same custom.check.1_1.updated_by.name for each newly created row in your forloop.

Hope this helps!
Let me know if something is unclear.

It is what I was after. Thanks.

Hi,

For the below code time stamp is added when I make attach file for the first time.
However when I add additional file or remove/replace one time stamp is not updated.

Is it possible to log time when ever I make changes?

{% stripnewlines %}
|–24%–|15%–|--+
{% newline %}
|Report|Initials|Date{% newline %}
{% fori attachement in custom.attachements_1_1 %}
| {% input attachement.file as:file %}
| {{ attachement.1_1.updated_by.name }}
| {{ attachement.1_1.updated_at | date:"%d/%m/%Y %H:%M" }}
|{% newline %}
{% endfori %}{% endstripnewlines %}

Many Thanks,
Ugis

Hi @Ugis,

This was a bug which should now be fixed by our developers.

Thank you for reporting this to us!

Kind regards,
Robin

Thanks. Works lovely now.