I am trying to build a flow that creates a sequential automatic number when an item is created in my Sharepoint list. I want the number to include the two-digit year followed by a dash and then a sequential number (i.e., 0001, 0002, etc.). I know I can do this by using formatdatetime() in the field I want to update. However, I need the sequential number on the end to restart at the beginning of each year, so tying the sequence to ID will only work for the remainder of this year. How can I format the second half of the number to meet this requirement?
Currently I am formatting the date via the following:
formatDateTime(utcNow(), 'yy') - formatNumber(triggerOutputs()?['body/ID'],'0000')