Auto Incrementing a column in sharepoint document library
I have an issue where I am stuck with auto incrementing a number in a document library.
The scenario :
I have a flow that is triggered manually that starts and approval process when a new file is uploaded(users click a button to start the flow for the file). The document library has a single line text column("Number") that is used for inputting some numbers that have a naming convention of *current year*+next available number so for example: 20210044,20210045,20210046 etc...
What I want to achieve is to populate that column automatically for the new items by grabbing the last item that was submitted (ex.20210045) and have an update function for the new item to be (20210046(last item number + 1)). What I did was concat the year with the ID but I don't want to grab the ID as its not used within the name.
I have tried numerous suggestions but alas i came to no solution. I would appreciate your input on this for a possible successful outcome for my issue :).