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 / Delete Column From a S...
Power Automate
Answered

Delete Column From a Spreadsheet if Row is Blank

(0) ShareShare
ReportReport
Posted on by 51

Hi all,

I'm trying to delete an entire row in Excel if the cell of column H is blank - I can get my flow to read the worksheet, but I can't seem to identify how to delete the row based on the criteria.

Think I've stared at it too long now - any ideas how I can achieve this? 

Thanks! 

I have the same question (0)
  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Use Read from Excel worksheet to get the data. Then do a Loop to iterate through the rows and check if the value at %ExcelData[LoopIndex][7]% is empty via an If condition. The LoopIndex there is generated by a Loop action, while the 7 is a column index for column H.

     

    If it is empty, use Delete row in Excel worksheet to delete the row.

     

    I would suggest looping from the end to the beginning, so that further rows do not get affected by the deletion. I.e. if you delete row 2, what previously was in row 3 will move up to row 2. So, it will be tricky to use the index. But if you start at the bottom and go up, it won't matter.

     

    To do that, make your Loop action start at %ExcelData.RowsCount-1% and end at 0, and iterate by -1.

     

    Also, in the Delete row from Excel worksheet actio , when you delete a row, make sure you use %LoopIndex+1% as the row index. This is because indexes are 0-based in PAD, but 1-based in Excel.

    -------------------------------------------------------------------------

    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

     

  • Gematria Profile Picture
    222 on at

    Many ways to do this, but I prefer this approach 🙂

     

    Comments in the Flow.

     


    Gematria_1-1698241428593.png

     


     

     

  • kylebunkin Profile Picture
    51 on at

    Perfect, thank you! 

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

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard