# Copy data from previous year to current year

**URL:** <https://community.silverfin.com/t/copy-data-from-previous-year-to-current-year/2695>\
**Category:** Templates\
**Created:** [September 7, 2026, 9:00am UTC](https://community.silverfin.com/t/copy-data-from-previous-year-to-current-year/2695 "2026-09-07T09:00:22Z")\
**Posts on this page:** 13\
**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:** [September 7, 2026, 9:00am UTC](https://community.silverfin.com/t/copy-data-from-previous-year-to-current-year/2695/1 "2026-09-07T09:00:22Z")

</div>

Hello,

In a disclosure I have the following code:

> Blockquote

{% fori Otherclausule2 in period.custom.OtherClausule2 %} {% assign $1 = 0 %} {% assign $2 = 0 %}  
{{ header\_text2 }}  
|-75%---------------------------------------------------------------------|-----------------------------------------------------------------------------+  
| _{% input Otherclausule2.Titel as:text placeholder:‘Titel clausule (in hoofdletters om in lijn te zijn met andere titels)’ %}_

| {% input Otherclausule2.Vrij as:text placeholder:‘Tekst in de taal van de export omdat de tekst niet automatisch wordt vertaald.’ %}  
{% endfori %}

> Blockquote

How can I change my code to make it possible to copy the data from previous year to current year without loosing existing date?

Thanks a lot,

Sylvie

---

<div class="post-metadata">

**Author:** ![Delphine\_Demeulenaer](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/delphine_demeulenaer/32/2374_2.png) [@Delphine\_Demeulenaer](https://community.silverfin.com/u/Delphine_Demeulenaer)\
**Post date:** [September 8, 2026, 8:11am UTC](https://community.silverfin.com/t/copy-data-from-previous-year-to-current-year/2695/2 "2026-09-08T08:11:39Z")

</div>

Hi @svalais!

To copy prior-year data into the current year, you mainly need to rely on Silverfin’s default carry-over and avoid rollforward tags that clear fields.

By default, custom input values are carried over when you use the ‘Actions → Copy data’ button on the top right side in the Silverfin platform.

 ![Screenshot 2026-09-08 at 10.08.44](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/2X/1/19654e32c5a3579c587b68829f0ac2996b217250.png)

More information about rollforward can be found [here](https://developer.silverfin.com/docs/rollforward)!

Does this provide the information you were looking for?

Kind regards,

Delphine

---

<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:** [September 10, 2026, 7:57am UTC](https://community.silverfin.com/t/copy-data-from-previous-year-to-current-year/2695/3 "2026-09-10T07:57:21Z")

</div>

We indeed use the function Actions - Copy data but for this part of code this is not working.

What do I need to change in my code to make it work?

Thanks a lot,

Sylvie

---

<div class="post-metadata">

**Author:** ![Delphine\_Demeulenaer](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/delphine_demeulenaer/32/2374_2.png) [@Delphine\_Demeulenaer](https://community.silverfin.com/u/Delphine_Demeulenaer)\
**Post date:** [September 10, 2026, 11:07am UTC](https://community.silverfin.com/t/copy-data-from-previous-year-to-current-year/2695/4 "2026-09-10T11:07:11Z")

</div>

Hi again @svalais!

The code snippet you provided doesn’t contain quite enough context for me to properly answer your question.

As I mentioned before, by default, custom input values are carried over when you use the **Actions → Copy data** button in the top-right corner of the Silverfin platform. If you’re not using any rollforward logic in your code (which I don’t see in the snippet you shared) the data should be copied over to the following year as expected.

The **Copy data** action can only be manipulated when rollforward tags or logic are implemented.

Are you using any rollforward tags or logic elsewhere in your code?

Kind regards,

Delphine

---

<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:** [September 10, 2026, 1:05pm UTC](https://community.silverfin.com/t/copy-data-from-previous-year-to-current-year/2695/5 "2026-09-10T13:05:54Z")

</div>

Hi again,

This a very long code and it is only in this place in the code that the copy data does not work. It is the only place with a table.

I think this is because I use period.custom.OtherClausule2 instead of custom.OtherClausule2 But if I change my code then I will lose the data that is already included in it and that is not good.

In addition, I take this information later in a document to have a nice layout for export and custom. OtherClausule2 doesn’t work.

How can I modify my code so that the copy data works without losing data and also that my export works.

I don’t use rollforward in all my code.

Thanks a lot,

Sylvie

---

<div class="post-metadata">

**Author:** ![Jarne\_Willaert](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/jarne_willaert/32/2425_2.png) [@Jarne\_Willaert](https://community.silverfin.com/u/Jarne_Willaert)\
**Post date:** [September 21, 2026, 1:37pm UTC](https://community.silverfin.com/t/copy-data-from-previous-year-to-current-year/2695/6 "2026-09-21T13:37:29Z")

</div>

Hi @svalais,

You are right. It is true that the rollforward issue comes from the fact that the custom database variables are linked with the period and not with the account template itself. This refers to `period.custom.OtherClausule2`and `custom.OtherClausule2`.

We are also advising you to create a new part in the account template and replace the period.custom with a normal custom, as from a certain period. With this logic, the custom fori stays the old period.custom collection and as from a certain date, it looks to the new normal custom database collection. Example:

```auto
{% assign period_year_end_date = period.year_end_date | date:"%F" %}
{% assign cut_off_date = "2025-06-30" %}

<table class="usr-width-100">
  <thead></thead>
  <tbody>
    {% if period_year_end_date > cut_off_date %}
      {% fori item in custom.some_collection_b %}
        <tr>
          <td>:::
            {% input item.description_a
              placeholder:"Decription"
            %}
          </td>
          <td class="usr-align-right">
            {% input item.description_b
              as:currency
              placeholder:0
            %}
          </td>
        </tr>
      {% endfori %}
    {% else %}
      {% fori item in period.custom.some_collection_b %}
        <tr>
          <td>
            {% input item.description_a
              placeholder:"Decription"
            %}
          </td>
          <td class="usr-align-right">
            {% input item.description_b
              as:currency
              placeholder:0
            %}
          </td>
        </tr>
      {% endfori %}
    {% endif %}
  </tbody>
</table>

```

So what we will do is build custom rollforward logic that copies the data in the period.custom database variable to the custom database variable.

```auto
{% for item in period.custom.OtherClausule2 %}
  {% capture namespace %}OtherClausule2_{{ forloop.index }}{% endcapture %}
  {% rollforward item.some_key custom.OtherClausule2.[namespace].some_key %}
{% endfor %}

```

We can solve this by adding custom rollforward logic in the code for this account template. The first step is to understand that a fori collection works with indexes. For example the variables in the first row are stored in `custom.OtherClausule2.OtherClausule2_1.some_key`and those on the second row in `custom.OtherClausule2.OtherClausule2_2.some_key`. More information on the rollforward of data in the fori collections, can be found [here](https://community.silverfin.com/t/case-migrate-data-from-one-collection-to-another-with-the-rollforward-function-copy-details/1493).

In your previous message, you are also referring to the fact that you want the data to be accessible in other templates. For that, you don’t need to link the custom database variable with the period drop. You can work with results or fetching the custom database variable directly by looping over the `period.accounts`and check `account.namespace.key` or `account.results.some_result_name`.

Let me know if you have any questions.

Kind regards,

Jarne

---

<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:** [September 25, 2026, 1:50pm UTC](https://community.silverfin.com/t/copy-data-from-previous-year-to-current-year/2695/7 "2026-09-25T13:50:28Z")

</div>

Hi Jarne,

As we work in this template by fiscal year, I will make the change for fiscal 207.

So I modified my code in the following way and it works when I want to copy the data.

> {% fori Otherclausule2 in custom.OtherClausules %}  
> _{% input Otherclausule2.Titel as:text placeholder:‘Titel clausule (in hoofdletters om in lijn te zijn met andere titels)’ %}_ {% rollforward Otherclausule2.Titel custom.OtherClausules[forloop.index0].Titel %} {% result ‘Otherclausule2.Titel’ custom.OtherClausules[forloop.index0].Titel %}  
> {% input Otherclausule2.Vrij as:text placeholder:‘Tekst in de taal van de export omdat de tekst niet automatisch wordt vertaald.’ %} {% rollforward Otherclausule2.Vrij custom.OtherClausules[forloop.index0].Vrij %} {% result ‘Otherclausule2.Vrij’ custom.OtherClausules[forloop.index0].Vrij %}  
> {% endfori %}

Now I’m trying to get his information in a text template via result tags but it doesn’t work.

I’ve already tried everything. How can I do it?

Thank you very much,

Sylvie

---

<div class="post-metadata">

**Author:** ![Jarne\_Willaert](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/jarne_willaert/32/2425_2.png) [@Jarne\_Willaert](https://community.silverfin.com/u/Jarne_Willaert)\
**Post date:** [September 29, 2026, 7:26am UTC](https://community.silverfin.com/t/copy-data-from-previous-year-to-current-year/2695/8 "2026-09-29T07:26:16Z")

</div>

Hi @svalais ,

Could you share a bit more context on the specific use case you’re trying to achieve?

Dynamically generating result names based on custom database variables is generally not a good approach.

To help find a cleaner pattern, could you clarify:

1. **Which specific data** are you trying to fetch or extract from the other templates?
2. **Why dynamic names feel necessary:** Would returning a structured key-value map (like a dictionary, object, or hash) satisfy your lookup needs instead?

If you can post a quick snippet of the template context and your intended end result, we can suggest a more maintainable approach.

Kind regards,

Jarne

---

<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:** [September 29, 2026, 12:32pm UTC](https://community.silverfin.com/t/copy-data-from-previous-year-to-current-year/2695/9 "2026-09-29T12:32:53Z")

</div>

Hi Jarne,

In the disclosure Tax recommendations, I completed the following:

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

For this I have the following code:

> {% fori Otherclausule2 in custom.OtherClausules %}  
> {{ header\_text2 }}  
> |-75%---------------------------------------------------------------------|-----------------------------------------------------------------------------+  
> | _{% input Otherclausule2.Titel as:text placeholder:‘Titel clausule (in hoofdletters om in lijn te zijn met andere titels)’ %}_ {% rollforward Otherclausule2.Titel custom.OtherClausules[forloop.index0].Titel %}  
> | {% input Otherclausule2.Vrij as:text placeholder:‘Tekst in de taal van de export omdat de tekst niet automatisch wordt vertaald.’ %} {% rollforward Otherclausule2.Vrij custom.OtherClausules[forloop.index0].Vrij %}  
> {% endfori %}

In the document that I use for the export I need to see the texts

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

I have this result when I use period.custom.OtherClausule2 instead of custom.OtherClausules.

Can you help me please?

Thanks a lot,

Sylvie

---

<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:** [September 29, 2026, 12:34pm UTC](https://community.silverfin.com/t/copy-data-from-previous-year-to-current-year/2695/10 "2026-09-29T12:34:08Z")

</div>

In the document I use the following code:

> {% for Otherclausule2 in period.custom.OtherClausule2 %}

{::group}

**{{ Otherclausule2.Titel }}**

{{ Otherclausule2.Vrij }}

{:/group}

{% endfor %}

---

<div class="post-metadata">

**Author:** ![robindeclercq](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/robindeclercq/32/472_2.png) [@robindeclercq](https://community.silverfin.com/u/robindeclercq)\
**Post date:** [October 1, 2026, 8:41am UTC](https://community.silverfin.com/t/copy-data-from-previous-year-to-current-year/2695/11 "2026-10-01T08:41:25Z")

</div>

Hi @svalais ,

Thanks for elaborating your use-case and sorry for the delayed reply.

So in this case, where you merely need payloads from the account template in your text file, you probably don’t need results. Results can be useful in case there is defaults for the inputs that need to be taken into account, but I don’t see those in your code example.

Instead, to gather the information from the account template in your text file, we can also just access the custom collection. There is bit of nuance to it, since account templates are not unique and don’t have handles, so we can’t reference them like that. Instead, we should provide a range of accounts and loop through it. So something like this:

```auto
{% assign accounts_in_range = period.accounts.include_zeros | range:49 %}

{% for account in accounts_in_range %}
  {% for Otherclausule2 in account.custom.OtherClausules %}
    {{ Otherclausule2.Titel }}
    {{ Otherclausule2.Vrij }}
  {% endfor %}
{% endfor %}

```

I used range 49 in my example, totally random ofc, if you could narrow down the range it would even be better. So we loop through all accounts in the range, and print the payloads stored in `account.custom.OtherClausules`.

Does this help?

Kind regards,

Robin

---

<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:** [October 1, 2026, 10:25am UTC](https://community.silverfin.com/t/copy-data-from-previous-year-to-current-year/2695/12 "2026-10-01T10:25:56Z")

</div>

Hello,

The information is not linked to an account template but is in a reconciliation.

So I can not link this to an account range.

Can you help me please?

Thanks a lot,

Sylvie

---

<div class="post-metadata">

**Author:** ![robindeclercq](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/robindeclercq/32/472_2.png) [@robindeclercq](https://community.silverfin.com/u/robindeclercq)\
**Post date:** [October 2, 2026, 11:12am UTC](https://community.silverfin.com/t/copy-data-from-previous-year-to-current-year/2695/13 "2026-10-02T11:12:46Z")

</div>

Hi @svalais ,

Oh, must have gotten confused somewhere in above thread, when re-reading you indeed never mentioned it concerned an account template, apologies! 😅

Well in that case it makes things even easier right? Then you can just access the collection linked to that RT like this:

```auto
{% for Otherclausule2 in period.reconciliations.[handle].custom.OtherClausules %}
  {{ Otherclausule2.Titel }}
  {{ Otherclausule2.Vrij }}
{% endfor %}

```

Replace `[handle]` by the correct handle where the inputs exist 👍 .

Kind regards,

Robin
