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 / I am trying to get all...
Power Automate
Suggested Answer

I am trying to get all emails to be stored in onedrive folder and i am running this by date

(0) ShareShare
ReportReport
Posted on by
The execution of template action 'Filter_array' failed: The evaluation of 'query' action 'where' expression '@equals(formatDateTime(item()?['DateTimeReceived'], 'yyyy-MM-dd'), formatDateTime(triggerBody()?['ArchiveDate'], 'yyyy-MM-dd'))' failed: 'The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'.
Categories:
I have the same question (0)
  • Suggested answer
    Vish WR Profile Picture
    3,748 on at
     
    The error indicates that one of the dates being compared is null. Most likely, ArchiveDate from the trigger doesn't contain a value, so formatDateTime() can't process it.

    I'd first add a Compose action to output triggerBody()?['ArchiveDate'] and verify it's populated. Also check whether DateTimeReceived is present for every email item being processed.
    If either value can be empty, add a null check before calling formatDateTime(). The issue is with missing data rather than the Filter Array logic itself.
  • Suggested answer
    chiaraalina Profile Picture
    2,425 Super User 2026 Season 1 on at
     
    formatDateTime(item()?['DateTimeReceived'], 'yyyy-MM-dd') failed because item()?['DateTimeReceived'] returned Null.
     
    That can happen for either of these reasons:
    1. The column/property exists but is empty for some email.
    2. More likely here: DateTimeReceived is not the correct property name, so Power Automate returns null. In my experience it is receivedDateTime. Please check in your Get emails action output. 
     
    Also check the manual trigger date field. Even if the input is displayed as ArchiveDate, the internal name may still be date. In that case, use:
    triggerBody()?['date']


    instead of:

    triggerBody()?['ArchiveDate']
     

    I would try this in Filter array advanced mode:

    @and(
    not(empty(item()?['receivedDateTime'])),
    not(empty(triggerBody()?['date'])),
    equals(
    formatDateTime(item()?['receivedDateTime'], 'yyyy-MM-dd'),
    formatDateTime(triggerBody()?['date'], 'yyyy-MM-dd')
    )
    )

    The not(empty(...)) checks prevent formatDateTime() from running on a null value. The formatDateTime(..., 'yyyy-MM-dd') part compares only the date portion, since the email received date/time usually includes a time value.
  • Vish WR Profile Picture
    3,748 on at
     
    Wanted to check if you were able to resolve your issue?
     
    Please âœ… Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like â™¥
    Visit my blog My Tech Space    LinkedIn  

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 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard