Help using OData filter on o365 Get Mail?

Hi all,

I’m new to using the Office 365 activities in UiPath but so far so good. I have Get Mail (o365) as part of my process and this is working fine for me, I also have a Query as I only want to get mail that meet a certain condition (as multiple robots may use the same inbox),. I have the query below currently which works, however I need to add a time-based condition to also only filter on mail that is <= 11.00am Today’s date.

Currently, the OData query I have is below (works):
“contains(subject,‘MY TEXT’) and (hasAttachments eq true)”

What I want it to be like (example):
“contains(subject,‘MY TEXT’) and (hasAttachments eq true) and Mail.DateTime <= 11am Today

How can I do this? I am unfamiliar with the OData syntax

Screenshot of Query in activity for reference, I use a query stored in Config file, but it is usually inserted here inside quotation marks

For time, try this:

ReceivedDateTime ge yyyy-MM-dd and receivedDateTime lt yyyy-MM-dd

where:

  • lt - Less than
  • ge - Greater than or equal to

You can access more information here: Use the $filter query parameter to filter a collection of objects - Microsoft Graph | Microsoft Learn

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.