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.
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.
Was this reply helpful?YesNo
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.