Repeating lists and reusing that data in another clause

hi,

in a clause I have written:

|| At the latest #debt^deadline || #debt^amount-to-be-payed ||

Both datafields are repeating lists, the one as a date and the other as a currency.

Let’s say we add 5 lines.

In another clause, I would like to use the data from the last line that has been added to the above repeating list, only line 5.

For example: This will happen after the last payment ( #debt^amount-to-be-payed in line 5) which needs to be executed the latest on #debt^deadline in line 5.

Can I do that? And how?

as an extra remark: in the second clause I would always want to add the last line from the repeating list.

Hi Sarah,

Good question, actually! Try this:

This will happen after the last payment (@get(#debt^amount-to-be-payed, @count(#debt^amount-to-be-payed))) which needs to be executed the latest on @get(#debt^deadline, @count(#debt^deadline)).

So what you are actually doing here with @get , is to grab a single value from the list of values stored in the datafield. For example, @get(#debt^amount-to-be-payed, 2) would grab the second value. However, you always want the very last value, so instead of hard-coding a number such as two, you use another function @count that calculates the amount of items currently stored in the list.

Hi Maarten, thx! I like to give you a challenge :slight_smile:

It nows seems a rather easy one.

1 Like