
Announcements
Hi!
How can I create a sequential numbering by year in a Sharepoint list. What would be the best way to handle this?
Test column
AE-0001-2022
AE-0002-2022
AE-0003-2022
AE-0001-2023
Whenever you create an item in the list, check the year and previous numbering to generate a new one and record it in the list item.
Hi @JarbasMartinho ,
In short words, you can use Get items action to get the Test column value of the last record in the list. Before that, you need to initialize two string variables, which could be used for storing the second and third part of the test column value.
In Update item, you can use a "concat" function to concatenate strings as well as variables with the dash symbol.
Expressions used:
last(split(items('Apply to each')?['Test column'],'-'))string(formatDateTime(utcNow(),'yyyy'))formatNumber(add(int(first(skip(split(items('Apply to each')?['Test column'],'-'),1))),1),'0000')concat('AE-',variables('1'),'-',variables('2'))
Best regards,