Hi all,
I have a question regarding how to automatically increment a row with a number (1 greater than the preceding row) in MS Excel whenever a new row is added in the ID column (see below). I am using an MS Form as a trigger to add a new row and the concept seems really straightforward, however I have not been able to get it to work. In my latest attempt as shown below, I am able to increment but it will add the same row anywhere from 12 times - 148 times. I am not sure what is missing and am open to any ideas on how to achieve the incrementation.
This is the current flow that I have. I am posting the overview and then the in-depth dynamic content (three parts) used to build the flow.
Flow Overview
Part 1
Part 2
Part 3
Excel Result
Note that this 15 times is added in one run, from one response to the flow. Sometimes it can be more than 15 using the same flow (and nothing has changed).
I have checked and I do not have concurrency enabled, and I have tried building flows using the following functions:
- integer function
- add function
- call the last row using last and then adding + 1
- composed various outputs
-Append Array Variable
- Converted to a string and then add string
And I have faced issues regarding the fact that the integer function requires an integer and although I have an integer, not sure what is going wrong. When I did compose the output of add, I got it to add a row, but it consistently said 1 for each entry and would not increment. I am sure this is pretty simple but not sure why I have not got it to work. I am open to any flow ideas to achieve my function.
Thank you so much for the help!
Thank you for your prompt response! Sorry I meant auto increment ID. Based on your response I tried the following flow but have been met with similar fate. Attached below is the flow based on your response.
However, the rows added are random and the ID does not increment. For example the first ID increment was 2, and another row the increment was also 2. The third test resulted in a ID of 3, however the following 4th test also had an ID value of 3. Wanted to share this flow incase I was doing something wrong on my end.
@RADSHAR You do not need to auto increment row. it will automatically append in last row. Do you want to increment ID?
Use length() to get number of items from list row present in a table action then set variable value as length() then increment variable by 1. Now your variable will have one value greater than previous one. Then use add a row into a table action .
No need to use apply to each.
Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.
Here is an example of another flow that I have tried. This one works 50% of the time, and the other 50% of the time it will either not increment and just upload with "2" or it will say the input is not an integer for the Compose 2 function. Very random. For the time it "works" the updated row will increment but every 4th try, it will not increment and take the number above the row. E.g. if it was 114 below, it will come up as 114 in the next.
Pstork1
20
Most Valuable Professional
rpersad
16
Michael E. Gernaey
12
Super User 2025 Season 1