Move Mail: Value cannot be null

Hi!

I’m having an issue with MicrosoftOffice365 Move Mail activity:

The variable all have values, the mail message has attachments that the bot managed to capture in a previous step from the same mailmessage and I have no clue about what is wrong.

Can anyone help me, please?

@adriano.dias,

If you are trying to move from One Mailbox to another then that’s not possible due to Graph API.

Hi!

Thanks for the reply.

I am not trying to move the mailMessage to from one Mailbox to another, it is in the same Mailbox, just moving from the Inbox folder to the ToBeProcessed folder.

The strange thing is: It was working a few days ago and now it just stopped working without any change to the bot.

@adriano.dias,

Can you try updating the packages to latest possible version.

It is updated to the latest already.
I have tried to downgrade the package as well, but this makes the file unopenable.

@adriano.dias,

Ok. Let me try to replicate this.

A few more informations:

The activity is inside a “For Each” for an array of “List Of” after getting a list of emails from the Inbox folder through a “Get mail list”.

I have even tried to create a separated file with only the get mail list, for each and move mail activities, with all parameter hard-coded, still the same error.

@adriano.dias,

Can you try using For Each Email activity to iterate instead of just For Each.

It actually worked, thank you!

I’m just thinking now that I will need to change A LOT of the bot’s logic to change to “For Each Email”. :sweat_smile:

1 Like

@adriano.dias,

Can feel the headache but this the way! :v:

Kindly close the thread by marking my answer as solution so it will be helpful to other community members as well :smiley:

Thanks,
Ashok :slightly_smiling_face:

Actually… It worked on the test file, but not on the actual code.
I have changed to move the email inside the “For Each Email”, but it gave me the same error as before.

The mail message has all the data available, such as ID, Body, Subject, etc.

I can’t find what is wrong with it.

@adriano.dias,

You can do one more approach.

Find the email by it’s id
Use Get Email by id activity
This will give you the email object. Pass this object to move email.

@adriano.dias

Open locals panel and check exception details there sometimes exact name of field which is missign will be given

cheers

Using the Local panel, I found out that the “SharedMailbox” field is being read as null, even though the field is filled in the activity. Here’s a comparison with the “Get Email By ID” activity:

Get Email By ID

Move Email

I think the activity is actually bugged and reads the value of the variable into the incorrect field. I hope I can find a way around, cause I need to fix it asap.

1 Like

@adriano.dias

Just to verify if it is a bug in the current version …try to change the activity package version either upgrade one version above or downgrade

Also before that try to re add the activity and check if it makes any difference…

Cheers

I have tested a few additional changes and found out that the activity works if I write the shared mailbox address manually, “test@test.com” for example, and use the folder picker.

But if I use a variable, it is not working, and it is simply sad, because we shouldn’t use hard-coded information like this.

@adriano.dias

Try to open the advanced editor in that field and then enter the variable and check

Also instead of inconfig try assigning it to a variable and then assign the varible there

Cheers

Was anyone able to resolve this issue with Move Mail : value cannot be null.

We are facing same issue with Microsoft Office365 version 2.7.22 and 2.7.23. When we pass the hardcoded values of Shared mailbox and folder path from the folder picker, it works fine. But when we pass the values using argument or variables (even tried from Advanced editor as someone suggested in this thread) the issue persists. The issue was not faced in the Office365 v2.6.25, only latest versions has issue.

Let me know if able to get past this or have some suggestions or ideas.

Thanks
Preet

@adriano.dias @preet1.singh Hi both,

When you pass the variable make sure its not a subfolder. If its a subfolder you have to pass file path inside the variable. For example: if you folder name in variable (testVariable) is Test2 but it is inside folder Test1 . The variable value should be testVariable = “Test1\Test2”

Outlook email  "Purchasing" with a sub-folder labeled "Purchasing Archive." (Captioned by AI)

I had the same issue when passing variable it was giving me null … its because you have to pass the folder structure in variable if its in subfolder… Hope this helps.

The activity works fine when not using the Shared mailbox. I see the screenshot has “Use shared mailbox” turned off.

Our requirement is to turn on the “use Shared mailbox” and then pass the properties of the shared mailbox like Shared mailbox name and the Folder path. The issue is while using this. Also, we are moving email to a subfolder and we are passing the full path including its parent folder.

Refer the screenshots and see that even though we passed those properties it is somehow not picked up by the activity while running. But when we hardcode the shared mailbox name and the folder path through folder picker it works.