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 Platform Community / Forums / Power Automate / Delete row if it is in...
Power Automate
Answered

Delete row if it is in the past

(0) ShareShare
ReportReport
Posted on by 1,089

Hi all,

 

I have this excel file and will delete the rows older than today.

1.png

 

Than i make this flow but it is not delete the rows from yesterday.

What is wrong?

2.png

Categories:
I have the same question (0)
  • efialttes Profile Picture
    14,756 on at

    Hi!

    Some thoughts

    First of all I am assuming 'Start Time' column in your excel file is formatted as Text not Date, right?

    Next, when you invoke utcNow() it provides date and time for UTC timezone. So, you will probably need to convert to your own time tone to avoid issues like the one you described. You can do it by means of the WDL expression convertTimeZone() but also by means of an action block with the same name.

    Hope this helps

  • frixel Profile Picture
    1,089 on at

    @efialttes 

     

    Thanks for your advise,

     

    I changed the format to "Date"

    1.png

     

    And changed also the UTC-Timezone

    3.png

     

    But the condition is always false.

    2.png

  • frixel Profile Picture
    1,089 on at

    @efialttes 

    Edit.

     

    Now the rows are deleted with the date format: 

    convertTimeZone(utcnow(),'UTC','W. Europe Standard Time','M/dd/yyyy HH:mm:ss')

     

    But it deletes al the rows from today also because the time is in the past.

    I want only delete rows with the date in the past.

     

    What must i change in the flow?

  • efialttes Profile Picture
    14,756 on at

    Hi again

    Sorry I didn't explained myself properly.

    I was just trying to confirm that the excel column was of type 'Text'; because if it is of type 'Date', it is internally handled as nr of days since 1899-12-30 and represented as a string, as explained here:

    https://www.bythedevs.com/post/working-with-date-time-data-of-excel-in-power-automate

    I would keep the column as 'Text' and try with the TimeZone conversion... assuming your date input format is yyyy-MM-dd

    Hope this helps

  • efialttes Profile Picture
    14,756 on at

    @frixel wrote:

    @efialttes 

    Edit.

     

    Now the rows are deleted with the date format: 

    convertTimeZone(utcnow(),'UTC','W. Europe Standard Time','M/dd/yyyy HH:mm:ss')

     

    But it deletes al the rows from today also because the time is in the past.

    I want only delete rows with the date in the past.

     

    What must i change in the flow?


    Can you share more details of your current Condition? Are you using 'less than' operator? 'less or equal'?

    As far as I understand, if dates are stored as text with format 'M/dd/yyyy HH:mm:ss' you need to reorder them first in order to make such operator work, i.e. use yyyy/MM/dd instead

    So this way 2020/08/16 (aug 16th 2020) is greater than 2019/09/16 (sept 16th 2019)

    But with the current representation in your Excel, I believe 8/16/2020 (aug16th 2020) is less than 9/16/2019 (sept 16th 2019)

     

    THanx!

  • frixel Profile Picture
    1,089 on at

    @efialttes 

     

    I thought it worked.
    I have now added an extra column to the sheet with only a date.

    1.png

     

    This is the flow with the condition.

    4.png

     

    All the rows will be deleted also the rows with date today.

  • frixel Profile Picture
    1,089 on at

    I don`t understand what i now must to do.

     

    I don`t understand what i must fill in for the dateformat in the condition.

  • Verified answer
    efialttes Profile Picture
    14,756 on at

    Hi again!

    I can see two approaches:

    1.- If you handle  Start Time on your excel column selecting its format as Date instead of text. THis way, 'List rows present in a table' will provide some funny numbers (days since Days Since 1899–12–30) as explaind in previous posts.

    In order to compare them with today, I would use the following WDL expression on the right side of you condition rule:

    string(div(sub(ticks(utcNow()),ticks('1899/12/30')),864000000000))

    2.- If you handle Start Time on your excel column with Text format, you definitly need to store it as yyyyMMdd in order to compare it properly with your today

     

    Hope this helps

  • efialttes Profile Picture
    14,756 on at

    @frixel 

    I just so this topic was marked as solved, so I guess it was you that followed the instructions and overcame your challenge. Thanx for your kindness, and Happy Flowing!

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 481

#2
11manish Profile Picture

11manish 278

#3
David_MA Profile Picture

David_MA 276 Super User 2026 Season 1

Last 30 days Overall leaderboard