cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ursNani
Advocate II
Advocate II

Auto generate Numbers for projects

Hi 
I am new to power Automate . I want to create a flow that can create auto number Like CPI-0001, 
"CPI-" This would be constant. xxx1 like number should change 
example : 0001 , 0002, ............, 0010,..............................., 0100, 0101 like 

please Help me how to do ?

3 REPLIES 3
Mister_Shaik
Super User
Super User

Hi @ursNani ,

 

Assuming that the data source is a SharePoint list, we can use "When an item is created" trigger to detect when a new item is created and then update the auto number field using the ID as counter.

 

Mister_Shaik_0-1643303434432.png

 

If you want to have leading zeros in the auto numbering, then you can refer this post to make the auto numbering with leading zeros: 
Solved: format a string with leading zeros in MS Flow - Power Platform Community (microsoft.com)

 

Hope you find this helpful! 🙂

 

Kind Regards,

Shaik Sha

________________________________________________________________________

If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

@Mister_Shaik 

But its work like CPI-1 ,CPI-2 .............etc
I would like to have CPI-0001,CPI-0002 ,........................ etc

thank you 

Mister_Shaik
Super User
Super User

Hi @ursNani ,

 

In that case, you can use the formatNumber expression,

 

formatNumber(triggerOutputs()?['body/ID'],'0000')

1. formatNumber.PNG

 

This will return the input number passed to expression in the format specified, eg:- 1,2,3 would be converted to 0001,0002,0003

 

Hope you find this helpful! 🙂

 

Kind Regards,

Shaik Sha

________________________________________________________________________

If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (3,181)