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 / Insert New Row Below E...
Power Automate
Unanswered

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, 
 
I have the same question (0)
  • Verified answer
    eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 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

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard