Last or biggest record of a list +1 - formula to achieve

Hi There,

I have a list with invoice numbers, for example (1, 2, 3, 4, 5)
When I create a new record that needs to be in sequence, it should be the last or biggest from the list +1.

Would be great to get some direction, thanks for your time.

//JP

Hi @Jean_Pierre_Traets,

Welcome to the forum! :slight_smile:

You can do that using the mathematical function max to get the max of the list of invoice numbers as shown in the snippet.

{note}
{invoice_numbers=[1,2,3,4,5]}
{new_invoice_number=max(invoice_numbers)+1}
{endnote: trim=right}
New Invoice Number: {=new_invoice_number}

2 Likes

Dear @Ashwin_Mittal1,

Thanks a lot for your kind support and yes this is exactly what I was looking for :slight_smile:

1 Like