Multiple Shared Mailboxes with For Each ErrorInvalidMailboxItemId

Hello, I want to read EMails with a specific filter from multiple shared mailboxes. I use the For Each Email activity from Outlook 365 and around that I use a for each loop which references to the List of mailboxes.
The first mailbox always works and sends the emails to orchestrator. On the second mailbox it always crashes with this error:
UiPath.MicrosoftOffice365.Office365Exception: An unspecified error has occurred. —> UiPath.MicrosoftOffice365.Office365InternalException: Code: ErrorInvalidMailboxItemId
Message: Item ‘testGE3Yy1hNmE3LTZlNGMyNzc4YTY3OAAuAAAAAAAerSX3IMxRTbOp-kg4XUYhAQAJsDt8pivSQp7pMAAA=’ doesn’t belong to the targeted mailbox ‘xyz’.

I have tried to log all the values on overy part of the process but they are always correct.

I also tried to have the list of general mailboxes in an array first and when this did not work I tried to have the list in a data table. This resulted also in the same error.
I attached this file where I tested the second method. Does anyone have the same issue?

To run this you would need

  • Outlook 365 Connector with an account that has access to at least two shared mailboxes
  • EMailList.xlsx (Sheet1) and the Header Name “Emails” and the two shared mailboxes in row 2 and 3

Main.xaml (21,5 KB)

@eric.brendel

Welcome to the community

How is the connector configured

As if you are trying from different mailboxes does all are accessed from same connection?

Cheers

@eric.brendel,

It seems issue of variable scope. Your first mailbox emails are still there in second mailbox iteration that’s why it’s throwing error doesn’t belong to the targeted mailbox ‘xyz’.

Check the variables are getting clear before iterating next mailbox.

Hi @Anil_G
I don’t exactly understand your question.
I am trying to access the mailboxes from the same connector, I think yes. Did you have a look at my example workflow?

best regards

Hi @ashokkarale
I tried to add an Assign activity at the end of every loop but this did not work.
I also checked the variable value while debugging with the Immediate output and the value was indeed correct.

Ok so I managed to solve this issue with support. The problem was the pakage version of Microsoft 365 (2.7.22) when we downgraded it to 2.6.25 it worked as it should.
The bug is reported internally and should be fixed soon.

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