Hello Power Automate users.
I have created a Flow to delete emails from a certain folder in Outlook after 24 hours.
It seems to work but the runs remain running when the mail is deleted.
I don't think this is desirable, right?
Do I have to adjust something in the flow so that the run stops when the mail is deleted that is in it for 24 hours?
@hongdet Thank you for your clear explanation.
But this flow doesn't clean up mail that is older than a dad, even if the mailbox is already empty?
Hi @frixel ,
No worries! 🙂
Sky is the limit for Power Automate, despite with no known built-in functionality on the platform, there's always another workaround to get the requirement fulfilled. I've done with quite an amount of workaround on the flows that I've built, taking this as an example; we use string to do comparison instead of using datetime directly 😛
I guess you'll have to google around a little more or wait for another expert coming in here to suggest an alternative method to achieve your requirement 😉
You might want to clean up your mailbox for the very first time (for mails way older then 24 hours) and thereafter this flow should do the job by cleaning it up on a daily basis.
All the best!
BR,
hongdet
Hey @hongdet
Yes that is what i mean, (sorry for my bad English 😂)
Ahh that's a shame because that's the goal of this flow.
Delete email older than (for example) 24 hours.
I've copied various flows using google/forum, but it seems (almost) impossible to make this.
Hi @frixel ,
I'll try my best to understand what you mean, I think you are asking where to set the amount of time for the email to be deleted right?
If that the case I'm afraid I can't help much, as I state initially I think the Condition action cannot compare datetime (or at least I'm not sure how that could be done). What we are doing here is basically comparing 2 string value (not date) and execute action upon matching.
@hongdet
where can I set after how much time (for example older than 24 hours) the flow will delete?
I'm not sure if the Condition action allows the checking of datetime format.
I would set the scheduled flow to run at 11.55PM every day. Thereafter, convert today's date and email receive's date to string before trying to match it using the condition action.
Hope this helps!
@fchopo @Sundeep_Malik @Srini007
I can`t get the flow working.
I have now this and that is running without error but i don`t understand it.
There is no difference in output when i changed the expression with -1hours or -12hours.
And is my Condition okay?
I think that mus be >The received date/time from the mail is before the convert time zone than delete.
Am i thinking right?
You can also call me a noob for this. haha.
I have never used it because, there was no such requirement till now.
Just happen to know about it.
Found this link that might help you:
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1