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 Automate
Answered

Looping through Excel

(0) ShareShare
ReportReport
Posted on by 61

How to loop through an excel using for each or loop condition and delete excel rows based on some column value . 

I have the same question (0)
  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    First use launch excel activity and then read excel work sheet 

    Then use for each and give input as the datatable which you get from read excel sheet activity and loop through it

    Take if condition and writte condition as below

    Currentitem[columnname] = your value

    In first operand of if activity

    Then select equal to in drop down 

    And write 

    True in the second operand 

    Then inside if activity use delete rows from excel or delete row from data table activities as per your requirement

     

    Hope this helps 

    Usha 

     

     

  • Sh99 Profile Picture
    61 on at

    Hello, 

     

    Thank you for your response. I used the same logic, however I am unsure as to what to mention in row number for delete rows if using for each loop and datatable.

  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    On which column based you need to delete rows write that condition in if activity and then use delete rows activity 

  • DeepaliJagtap Profile Picture
    68 on at

    Hi,

    You can use counter variable before loop to keep track of row number to be deleted and increment it in loop. Please find below screenshot to delete row based on certain column value: in below screenshot Fruit is highlighted which is column name mentioned in "" i.e. "Fruit" and Orange is value mentioned for that column to delete that row. In delete action I added +2, as first row is taken as header in read from Excel worksheet action and row index starts with 0 so to delete exact row, added +2 in row counter.

    DeepaliJagtap_3-1704792747928.png

     

    Please mark this as solution if it helps you solve issue. Happy to help you more. 🙂

     

  • Sh99 Profile Picture
    61 on at

    Thanks this is helpful !!

  • Sh99 Profile Picture
    61 on at

    Is there any other option for getting the row number of an excel if a particular value is found? 

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You can use the Find and replace cells in Excel worksheet action to find the column and row indexes for a cell where a match was found.

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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard