web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Auto increment a row i...
Power Automate
Unanswered

Auto increment a row in MS Excel using Power Automate

(0) ShareShare
ReportReport
Posted on by 8

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

RADSHAR_0-1673554858137.png    

Part 1

RADSHAR_1-1673554889653.png

 

Part 2

RADSHAR_2-1673554983904.png

 

Part 3

RADSHAR_3-1673555001739.png

 

Excel Result

RADSHAR_4-1673555050446.png

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!

Categories:
I have the same question (0)
  • RADSHAR Profile Picture
    8 on at

    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.

    RADSHAR_0-1673562462802.png

     

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @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.

    @Hardesh /Gopenly.in

     

  • RADSHAR Profile Picture
    8 on at

    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.

    RADSHAR_0-1673566986894.png

    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.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard