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

View solution in original post

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (2,504)