Solved

Get data from a sub folder of a shared mailbox in Exchange

  • 21 January 2024
  • 1 reply
  • 27 views

Badge

Im trying to design a select query to get the email items in a Inbox subfolder of a shared mailbox when using the Exchange ODBC driver (Exchange online/Office 365). I can get to the shared folder inbox but not query the subfolder. Can anyone help me figure it out please?

icon

Best answer by Ethem Q 22 January 2024, 21:05

View original

1 reply

Userlevel 5
Badge

Hi @RichardGardner 

In order to get Items from a SubFolder via the Exchange ODBC driver you will need to specify the ParentFolderId as well as the SharedMailboxEmail pseudo column in your query. You might want to try a query as follows:

SELECT * FROM Inbox where ParentFolderId in (Select FolderId from Folders where ParentFolderName='Inbox') AND SharedMailBoxEmail='shared_email'

In case you want to get data for a particular SubFolder you can try the following:

SELECT * FROM Inbox where ParentFolderId in (Select FolderId from Folders where DisplayName='name') AND SharedMailBoxEmail='shared_email'

You can read more about this in the help documentation:

https://cdn.cdata.com/help/CEJ/odbc/pg_ewstable-inbox.htm#select-emails-from-inbox-subfolders 

If you have any other questions or encounter any technical issues you can always reach out to our support team at support@cdata.com or submit a support ticket with us here.

Reply