cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tapesh
Post Prodigy
Post Prodigy

Auto Increment ID duplication using flow

Hi All,

 

Im trying use forms and flow together, when the form response has submitted the ID in excel on Splist should be updated by 1 after every new response submitted. However, i found that we can use the increment variable to acheive this, but while im trying to update the file after the response submitted, the variable is showing me same duplicate value. 

 

i want results to be 1,2,3,4,5 and so on 

 

Please see screen shots: Flow1Flow1Flow2Flow2Sharepoint ListSharepoint List

1 ACCEPTED SOLUTION

Accepted Solutions
v-alzhan-msft
Community Support
Community Support

Hi @Tapesh ,

 

Already offer a solution in the link below and please reply to this link if you have any problem:

https://powerusers.microsoft.com/t5/Using-Flows/Auto-Increment-ID-duplication/m-p/518841/highlight/f...

 

I would offer you the workaround to create a new sharepoint list with a Number type column, and create an item in the list with the Number column save the initial value and update the value once a form response is submitted.

 

Steps:

1. Create a new list "ListNew" with a Number type column Name "Number", create the first item in the list with the Number column set to 1000, the id of this item would be 1 since this is the first item in the new list, the screenshot of the list as below:

 
 

2. Create a flow to add a new item for the new response when the response is submitted as my screenshot below:

1.png2.png

The flow would get the Number from the listNew, append 1 to the number and use the number to create new item in the list that you need, then update the Number with value(already append 1) in the list.

 

Hope the solution could help you.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
ChristianAbata
Super User
Super User

@Tapesh  this is becouse your initial value is 112 and every time your flow runs starts in 112 an increments 1.

To do an autoincrement counter what I do is create a sharepoint list, then add an item, so in the next step I get the ID of the list. See the ID is an autoincremental so by default if my flow runs for first time I get 1, then in a second 2 and then 3...



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

sounds great, but to be specific, im tryng to update the excel sheet present in sharepoint, 

 

when a form response is submitted, 

get response details,

inititialize variable, 

increment variable by 1

and then add the row to the table, 

 

this is my current process,

 

any suggestions?

@ChristianAbata 

Shure @Tapesh  you need to add this

 

when a form response is submitted, 

get response details,

create item (Sharepoint) here you can add whatever you want remember we need just the ID 

and then add the row to the table, (the ID autogenereated)



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

I agree with this solution, 

 

but what if i want to start number with 123456 and not with the number which sharepoint list has, as this solution only shows me that i can use Sharepoint Id, in real i want to start my own number series as you know that Sharepoint id can not be reset to the number i want so i want custom number, do you have thought to this ? @ChristianAbata 

if you want to manage your own number you eventually needs a sharepoint list to save the value of your sharepoint list for example

 

you start with 123 and then you add an autoincremental to grow to 124 you need to save that value and at the start of your flow you need to read that last value 124 and then your flow is going to add 1 so is 125... and here you rocks it's your own  autoincremental



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

I tried as you said but still same, do you have practical solution, can you show me how you want the flow to be excecute

 

Untitled.png

Excellent @Tapesh  but you need to get the last value of your list.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

How will do that? 

i used get items at first to get the details, how can we retrieve the last item record @ChristianAbata 

@Tapesh  shuse use this.

body('Get_items')?['value'][0]['ID']

lista.PNG 



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
v-alzhan-msft
Community Support
Community Support

Hi @Tapesh ,

 

Already offer a solution in the link below and please reply to this link if you have any problem:

https://powerusers.microsoft.com/t5/Using-Flows/Auto-Increment-ID-duplication/m-p/518841/highlight/f...

 

I would offer you the workaround to create a new sharepoint list with a Number type column, and create an item in the list with the Number column save the initial value and update the value once a form response is submitted.

 

Steps:

1. Create a new list "ListNew" with a Number type column Name "Number", create the first item in the list with the Number column set to 1000, the id of this item would be 1 since this is the first item in the new list, the screenshot of the list as below:

 
 

2. Create a flow to add a new item for the new response when the response is submitted as my screenshot below:

1.png2.png

The flow would get the Number from the listNew, append 1 to the number and use the number to create new item in the list that you need, then update the Number with value(already append 1) in the list.

 

Hope the solution could help you.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (5,374)