Question

Outlook API fails to retrieve emails within specified date range despite correct filter query that works in Microsoft Graph.

  • 19 February 2024
  • 3 replies
  • 104 views

Hi,

I am going crazy trying to create a routine that retrieve email from outlook on a specific date range correctly. 

When I try the query below on the Microsoft Graph environment works as expected.

https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages?$filter=receivedDateTime ge 2024-02-11T22:00:00Z and receivedDateTime lt 2024-02-12T22:00:00Z

when I add a zap with the outlook api call and I add this in the first screenshot 

despite passing correctly the filter 

it only retrieve email from today and not my specified range.

I also tried this format that does not give error but still does not work

Am i doing something wrong? How is possible that the exact same query works in Microsoft Graph why in here it does not pass the range and just retrieve the today email?


3 replies

I was wondering if anyone else got the same problem? Or if you can suggest a workaround?

Hi Mike, 

Yes, any search criteria will only return the email of the day, never in the specified range, however in the Microsoft Graph environment the same query works perfectly. 

Userlevel 7
Badge +12

@cm2024

Have you tried modifying the search criteria?

 

receivedDateTime >= 2024-02-11T22:00:00Z and

receivedDateTime < 2024-02-12T22:00:00Z

Or

receivedDateTime >= ‘2024-02-11T22:00:00Z’ and

receivedDateTime < ‘2024-02-12T22:00:00Z’

 

Kind regards,

Mike

GetUWired

Reply