
Announcements
Hi All,
How to create an auto increment ID number according to the order of submission in that month?
Pattern = CF-xx-MMyyyy
Details:
CF = Text ID which will always be the same for all documents
xx = the number of documents made in that month
MMyyyy = Month & Year
Example =
CF-01-012024 = First document made in Jan 2024
CF-03-012024 = Third document made in Jan 2024
CF-01-022024 = First document made in Feb 2024
I already tried working with Get items filter query, compose & initialize variable but the flow failed.
Can someone help me with this?
Thanks a lot!
Hi @pw23
see the below design
1. Use get items where items are filtered based on created date (when created date is current month)
Filter query used - Created ge '@{startOfMonth(utcNow(),'yyyy-MM-dd')}' and Created le '@{addToTime(startOfMonth(utcNow()),1,'Month','yyyy-MM-dd')}'
2. used create item to create item based on above get items results to create ID
Title has been considered as ID . Expression used- CF-@{formatNumber(add(length(outputs('Get_items')?['body/value']),1),'D2')}-@{formatDateTime(utcNow(),'MMyyyy')}
See the results below
There are 4 items created in sharepoint list for this month so created one is 5th item
Hope it helps !
Nived N 🚀
LinkedIn: Nived N's LinkedIn
YouTube: Nived N's YouTube Channel
🔍 Found my answer helpful? Please consider marking it as the solution!
Your appreciation keeps me motivated. Thank you! 🙌