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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Insert New Row Below E...
Power Automate
Answered

Insert New Row Below Each Row With Specific Value

(0) ShareShare
ReportReport
Posted on by 8
I am new to Power Automate and I have hit a brick wall. 
I am trying to get PAD to Go through an Excel spreadsheet starting at row 5 and add a new row below each row that has a value greater than 379.11 in Column H and Fill that new Row with the Same data as the Row that triggered it's creation except Column H cell will have the value of the previous row minus 379.11.
 
However, I am still stuck on the new row creation. 
For Some reason I just cannot get it to work. It always gets hung up on the first case and inserts a new row in the same spot over and over.
I believe I have misunderstood how this works and could really use some assistance.
The data is not in a table due to specific reason that were not told to me, but i was told it cannot be in a table format.
 
I have tried:
Loop "Index" from 0 to "%Variable.RowsCount -1%"
Loop "Index" from 0 to "%Variable.RowsCount%"
Loop "Index" from 0 to "%Variable.RowsCount+1%"
 
Loop "Index" from 5 to "%Variable.RowsCount -1%"
Loop "Index" from 5 to "%Variable.RowsCount%"
Loop "Index" from 5 to "%Variable.RowsCount+1%"
 
IF (Variable[Index][0]) is not Blank then
     IF (Variable[Index][0]) is >379.11
IF (Variable[Index][0] +1) is not Blank then
     IF (Variable[Index][0]) is >379.11
IF (Variable[Index][0] +1) is not Blank then
     IF (Variable[Index][0]+1) is >379.11
IF (Variable[Index][0] +2) is not Blank then
     IF (Variable[Index][0]+1) is >379.11
 
Insert a row above row with  index "Index"
Insert a row above row with  index "Index + 1"
Insert a row above row with  index "Index + 2"
Insert a row above row with  index "Index + 3"
Insert a row above row with  index "Index + 4"
Insert a row above row with  index "Index + 5"
 
I really think I just misunderstood how to do it and could use some guidance. 
I appreciate any help I can get. Thank You, 
 
Flow.png
Pre-Flow Data Sample.png
Post-Flow Data 1.png
I have the same question (0)
  • Verified answer
    eetuRobo Profile Picture
    4,522 Super User 2026 Season 1 on at
    Remeber that PAD is using 0 based indexing. So Excels first row in PADs datatable is always 0 and second row is 1 etc.


    And the Insert row to Excel worksheet -action will insert the row above the row you give it. So if you give row number 5 then new row will be created above that so at number 4.

    So since you want to insert empty row after the first row that has value over 379.11 then you need to give LoopIndex + 2 (1 for correcting the 0 indexing and 1 for adding the row after the current one).


    One way you could do this process would be to actually go from the highest row number to the lowest so you don't need to re-read the excel data since the indexing goes down and new rows won't affect the next looped row index.

    Like so: 
     
    The set variable for CurrentItem is just for debugging to see which is the current value.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 976

#2
Valantis Profile Picture

Valantis 863

#3
Haque Profile Picture

Haque 547

Last 30 days Overall leaderboard