cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FlowUser2487
New Member

Unable to process template language for deleting old O365 mails

Dear all,

 

I'm relatively new to power apps and have a problem I can't solve.

I want to delete mails in a specific folder that are older than X days. So far so fine, I followed the instructions of a guide and set everything up. But while testing it I always get an error:

Spoiler
Unable to process template language expressions for action 'Condition_2' at line '1' and column '15804': 'The template language expression 'formatDateTime(item()['DateTimeReceived'],'yyyy-MM-dd')' cannot be evaluated because property 'DateTimeReceived' doesn't exist, available properties are 'id, receivedDateTime, hasAttachments, internetMessageId, subject, bodyPreview, importance, conversationId, isRead, isHtml, from, toRecipients, attachments, body'. Please see https://aka.ms/logicexpressions for usage details.'.

The condition is setup as following:

if

formatDateTime(item()['DateTimeReceived'],'yyyy-MM-dd')

is less than

addDays(utcNow(),-30,'yyyy-MM-dd')

 

Do you know how I can fix the error and get the flow working? (as recommended in some other articles I already tried to save it with a different name and to re-submit/re-deploy it)

 

2021-10-19 10_05_18-Window.png

1 ACCEPTED SOLUTION

Accepted Solutions
ScottShearer
Super User
Super User

@FlowUser2487 

Try changing DateTimeReceived in your expression to receivedDateTime

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

2 REPLIES 2
ScottShearer
Super User
Super User

@FlowUser2487 

Try changing DateTimeReceived in your expression to receivedDateTime

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
FlowUser2487
New Member

Dear @ScottShearer 

Thank you, that solves the error message. Now the flow runs without errors.

But it still doesn't seem to run properly.

The deletion command results in

"ActionBranchingConditionNotSatisfied. The execution of template action 'Delete_email_(V2)_2' skipped: the branching condition for this action is not satisfied."

Even though there are the full 25 max items that should get deleted. Any tips for me?

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (3,747)