Closed mstackhouse closed 2 years ago
Just a note - I double checked and made sure I'm using the latest CRAN release.
Unfortunately support for things like filtering and sorting is very patchy in the underlying Graph API. Some ops will work as intended, others will have only limited functionality, and others just don't work. From what I remember, many the email ops are in the latter 2 categories.
For now, the workaround is to pull everything that you need (filtering works here), and then do anything else client-side.
Thanks for the quick response!!!
If anyone else comes across this issue, here's how you'd make a filter condition for both an email and date of receipt:
# Get the outlook connection
x <- Microsoft365R::get_business_outlook()
# Use the `list_emails()` method with the OData expression
y <- x$list_emails(
filter="from/emailAddress/address eq 'user@domain.com' and ReceivedDateTime ge 2022-08-01"
)
Help documentation is right here - but crafting the filter conditions takes some digging into Microsoft's documentation
From what I can gather, when I use a filter condition on an
ms_outlook$list_emails()
call, it overrides theby
option and just sorts by ascending date.Created on 2022-08-30 by the reprex package (v2.0.1)