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

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

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