Skip to main content

Notifications

Community site session details

Community site session details

Session Id : UlYcQpoNK6Lein/t2s+Ic7
Power Automate - Building Flows
Answered

Is the Message ID of an email supposed to change when moving that email to a new Outlook folder

Like (0) ShareShare
ReportReport
Posted on 20 Dec 2018 15:42:49 by 2

Is the Message ID of an email supposed to change when moving that email from one Outlook folder to another Outlook folder with Flow or PowerApps?

 

I am trying to build a PowerApp to keep incoming emails organized in folders based on a workflow.  The incoming emails must be reviewed, assigned, processed and then saved as originally received.  This was previously performed manually via drag and drop by multiple users with rights to the email account.  This prior approach eventually led to misfiled emails with little accountability for the users.

 

The proposed solution uses Flow to provide a Message ID of an incoming email when it arrives in a folder and then store that Message ID along with other email fields in a SharePoint list via Flow Create Item.  My intent is to have each user review the emails via PowerApps, and then use the PowerApps Office365.Move([Message ID], folderPath) function to move an email from a first folder to a second folder to a third folder, etc... as the message proceeds through the workflow.  The Office365.Move function works fine when moving an email from a first folder to a second folder, but it always fails when trying to move the same email from the second folder to a third folder when using the originally saved Message ID value.  PowerApps will display a 502 error “Request failed. Try again later..” or a 404 error “The specific object was not found in the store…” when the attempt to move the email fails.

The issue is (I think) that whenever you move an email via Flow or PowerApps, the Message ID changes which breaks the reference between my SharePoint list item and the corresponding email. 

 

The issue can be recreated with the following procedure to play a bit of Flow ping-pong:

  1. Create two folders in your Outlook inbox (e.g., TestFolder1, TestFolder2)
  2. Create a Sharepoint List with an “EmailID” field (single line text) and “Direction” field (single line text)
  3. Create a first Flow with three steps:
    1. Trigger on email arrive in TestFolder1
    2. Create Item in your SP list with *Title = [Subject] and EmailID=[Message ID] from the email in the trigger, and add a string in the Direction field to something like “Received in Folder 1”
    3. Move the Email based on the EmailID field to TestFolder2
  4. Create a second Flow with three steps:
    1. Trigger on email arrive in TestFolder2
    2. Create Item in your SP list with *Title = [Subject] and EmailID=[Message ID] from the email in the trigger, and add a string in the Direction field to something like “Received in Folder 2”
    3. Move the Email based on the EmailID field to TestFolder1
  5. Send yourself an email with “Test Email” in the subject line, and then drag that email into TestFolder1.
  6. Let the Flows run until you have a few data points to look at.
  7. Don’t forget to turn the Flows off!

 

When you do that, you can see that the EmailID columns are not exact.  The majority of the characters match, but look at the end of the string.  Here is what my data looked like when I ran the procedure above (I redacted the similar middle parts of the EmailIDs for efficiency of this post):

Title

EmailID

ReceiveTime

FolderDirection

Test Email Ping-Pong

AAM ***** QMbqoAACKHjbgAAA=

12/14/2018 5:10

Received in Folder 1

Test Email Ping-Pong

AAM ***** QMbqoAAD4E8pNAAA=

12/14/2018 5:10

Received in Folder 2

Test Email Ping-Pong

AAM ***** QMbqoAAD4E842AAA=

12/13/2018 21:10

Received in Folder 1

Test Email Ping-Pong

AAM ***** QMbqoAAD4E8pOAAA=

12/13/2018 21:10

Received in Folder 2

Test Email Ping-Pong

AAM ***** QMbqoAAD4E843AAA=

12/13/2018 21:10

Received in Folder 1

Test Email Ping-Pong

AAM ***** QMbqoAAD4E8pPAAA=

12/13/2018 21:10

Received in Folder 2

Test Email Ping-Pong

AAM ***** QMbqoAAD4E844AAA=

12/13/2018 21:10

Received in Folder 1

Test Email Ping-Pong

AAM ***** QMbqoAAD4E8pQAAA=

12/13/2018 21:10

Received in Folder 2

Test Email Ping-Pong

AAM ***** QMbqoAAD4E845AAA=

12/13/2018 21:10

Received in Folder 1

 

If you try to use those EmailID values in a subsequent Flow or PowerApps function (e.g., Office365.GetEmail(EmailID).Subject) they will all fail except the last entry.  That one usually works. 

 

Assuming the above is correct, how can I determine the Message ID after a move operation?  Do we need all of the characters in the Message ID string or can we use a Left(n) operation to use the characters that do not appear to be changed?  Are there any other methods to use Flow and PowerApps to track an email regardless of its folder location?

 

Any assistance with this issue will be greatly appreciated.

Thanks!

  • Lucian Profile Picture
    256 on 10 Jul 2023 at 12:49:51
    Re: Is the Message ID of an email supposed to change when moving that email to a new Outlook folder

    Hi @TClark ,

     

    Trying to find a way to move & flag email messages based on some Power Automate action I could find some usefull insights:

    1. After each Move action I'm "saving" the newly generated Message ID to keep track of the message. The problem with this approach is that if along the processing the user will manually move the message into another folder will break the flow.

    2. It seems that using Get email action using the "original" MessageID along with the optional "Internet Message ID" will find that message no matter where or when was moved. So before flagging or moving again this action will get the new Message ID wherever the message was moved.

     

    GetMessage.jpg

     

    Hope this is usefull and there is no need for Graph calls or something else.

     

    Kind Regards,

    Lucian

  • Lucian Profile Picture
    256 on 31 Mar 2023 at 14:10:38
    Re: Is the Message ID of an email supposed to change when moving that email to a new Outlook folder

    Hi @TClark 

    I have reached this message because now I need the same thing, and it seems that after 4 years still no solution for this. 🙁

     

    So I post your link to this idea and maybe we could raise more votes:

     

    A constant Message ID value to access a message regardless of Outlook folder location

     

  • Verified answer
    v-yuazh-msft Profile Picture
    on 21 Dec 2018 at 06:58:03
    Re: Is the Message ID of an email supposed to change when moving that email to a new Outlook folder

    Hi @TClark

     

    Yes, as you said, the Message ID of an email would change when moving an email to a new Outlook folder, and I afraid that there is no any way to know the new Message ID of the email in microsoft flow, so you requirement maybe couldn't be achieved within microsoft flow currently.

     

    If you would like to know the new Message ID of an moved email or any methods to track an email regardless of its folder location to be added in microsoft, you could submit an idea to microsoft flow idea forum:

    https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

     

    Best regards,

    Alice

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 97

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 48 Super User 2025 Season 1

Overall leaderboard
Loading started