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 / Skip data on Excel col...
Power Automate
Answered

Skip data on Excel column from Power Automate desktop flow

(0) ShareShare
ReportReport
Posted on by 50

I have Excel data on same column from 2 different dates like below:

AdyG_0-1719412433231.png

 

However to read the data, I have to ignore only the value that says "2-Jun". So in all, I need to read the 6 rows.

It could be any date, so I can't make it to filter out just "2-Jun".

Also I can't get rid of this date. It has to be there on the original file, after I do the manipulations based on the 6 rows.

 

Things I tried but were not successful:

1. Reading the Excel data using SQL queries, couldn't get rid of this cell temporarily.

2. Set a list variable to have all dates from 1st to 31st and put for each loop to read the number.

 

AdyG_1-1719413253485.png

 

Please guide me on how I can do this.

Thanks.

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

    Hi @AdyG 

    Will the date be same format????

    If so 

    Fst read the excel using launch excel and read Excel sheet then use find and replace datatable activity then give regular expression from for the date formats 

    Then you can delete the date value from the index you get from find and replace activity and you can write it into new sheet or new excel sheet.

     

    Hope this helps,

    Usha 

     

  • NathanAlvares24 Profile Picture
    1,714 Moderator on at

    Hi @AdyG !

     

    Follow this flow.

    NathanAlvares24_1-1719422092579.png

     

    My excel file what it looks like:

    NathanAlvares24_1-1719419079466.png

     

    Configuration of some actions:

    NathanAlvares24_2-1719419218112.png

    NathanAlvares24_3-1719419230830.png

    NathanAlvares24_4-1719419247541.png

     

     

     

    The regex used in action 3:

     

     

     

    ^\d{1,2}-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[a-z]*$

     

     

     

     

    Code (just copy and paste into your flow):

     

     

     

    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Users\\UserName\\Desktop\\Book1.xlsx''' Visible: True ReadOnly: False Instance=> ExcelInstance
    Excel.ReadFromExcel.ReadAllCells Instance: ExcelInstance ReadAsText: False FirstLineIsHeader: True RangeValue=> Column_Data
    Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableWithRegexEverywhere DataTable: Column_Data AllMatches: True ValueToFind: $'''^\\d{1,2}-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[a-z]*$''' TextToReplaceWith: $'''%''%''' DataTableMatches=> DataTableMatches
    LOOP LoopIndex FROM 0 TO Column_Data.RowsCount - 1 STEP 1
     SET varColumn_Data TO Column_Data[LoopIndex][0]
     IF IsEmpty(varColumn_Data) THEN
     Variables.DeleteRowFromDataTable DataTable: Column_Data RowIndex: LoopIndex
     END
    END
    Excel.CloseExcel.Close Instance: ExcelInstance

     

     

    Output:-

    Before (when reading data):

    NathanAlvares24_0-1719421949680.png

     

    After(1. replace dates using the regex and then 2. delete the empty rows obtain a filtered data table):

    1.

    NathanAlvares24_3-1719422244185.png

     

    2.

    NathanAlvares24_2-1719422131992.png

     

    I hope this helps.

  • Verified answer
    Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 on at

    @AdyG 

     

    You can follow the below approach:

     

    Deenuji_1-1719420628143.png

     

    Code:

    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Boot\\Q.xlsx''' Visible: True ReadOnly: False Instance=> ExcelInstance
    Excel.ReadFromExcel.ReadAllCells Instance: ExcelInstance ReadAsText: False FirstLineIsHeader: False RangeValue=> Column_Data
    SET Counter TO 0
    LOOP FOREACH CurrentItem IN Column_Data
     Text.ParseText.RegexParseForFirstOccurrence Text: CurrentItem[0] TextToFind: $'''\\b\\d{1,2}-[A-Za-z]{3}\\b''' StartingPosition: 0 IgnoreCase: False OccurrencePosition=> Position Match=> Match
     IF Position = 0 THEN
     Display.ShowMessageDialog.ShowMessage Title: $'''Info''' Message: $'''Its date value: %Match%''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
     Variables.DeleteRowFromDataTable DataTable: Column_Data RowIndex: Counter
     SET Counter TO Counter - 1
     ELSE
     Display.ShowMessageDialog.ShowMessage Title: $'''Info''' Message: $'''Not matched with Date format: %CurrentItem[0]%''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
     END
     SET Counter TO Counter + 1
    END

     

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • AdyG Profile Picture
    50 on at

    Thank you so much everyone!

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

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard