Automation for increment button

Hello there!

I’m trying to implement a button where I could increment a number of a column based on the selected number.
Like, I’m building a financial tracker and for Installments Payments I want to put the last payment to be made and based on it add a button where the rows is inserted updating the payments, for example:

  • January payment 1/3
  • February payment 2/3
  • March payment 3/3

I could do a button using sequence where I insert the three rows but the installment payment could not be incremented.

I’m sharing the code that I’m using below and the result.

Sequence(1, tonumber(parcela_fim_select))
.formulamap(
AddRow(
[BD - Despesas].[Parcelas Inicio],1,
[BD - Despesas].[Parcelas Fim],parcela_fim_select,
)
)

The result is this one

I want that the column called “Parcela Inicio” could be incremented one by one for each row, e.g first row is “1”, second row “2” and the last one is “3” based on the value os the input parcela_fim_select.

You could use the function CurrentValue instead of 1