web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Message ID in Flow unlike in Outlook Online - Encode Problem?

(0) ShareShare
ReportReport
Posted on by

Hallo Community,

in my business case I want to create a list element every time a mail arrives in a shared mailbox. The list elements should contain a link to the original mail in the shared mailbox.

 

The URL to a mail in Outlook Online looks like this:

https://outlook.office.com/owa/?viewmodel=ReadMessageItem&ItemID=AAMkADVhZDZiMTE3LTIxNDctNDljYy1hOTUxLTQ5OTViYzAyZTE3ZQBGAAAAAAD%2FJNp3P%2BtaTaPKITsM2XGQBwB52h5ChXJpRK9bvJuZTbRMAAAAAAEMAAB52h5ChXJpRK9bvJuZTbRMAAADQZjTAAA%3D&wid=40&ispopout=1&path=

 

I crated the link with the message id, which I get from the flow.

https://outlook.office.com/owa/?viewmodel=ReadMessageItem&ItemID=[messageID]

 

The problem are the special characters:

In the URL stands %2F (“/”) and %2B (“+”).

Example:

https://outlook.office.com/owa/?viewmodel=ReadMessageItem&ItemID=AAMkADVhZDZiMTE3LTIxNDctNDljYy1hOTUxLTQ5OTViYzAyZTE3ZQBGAAAAAAD%2FJNp3P%2BtaTaPKITsM2XGQBwB52h5ChXJpRK9bvJuZTbRMAAAAAAEMAAB52h5ChXJpRK9bvJuZTbRMAAADQZjTAAA%3D&wid=40&ispopout=1&path=

 

In the flow the message ID contains “-” and “_” instead of the "/" and "+".

AAMkADVhZDZiMTE3LTIxNDctNDljYy1hOTUxLTQ5OTViYzAyZTE3ZQBGAAAAAAD-JNp3P_taTaPKITsM2XGQBwB52h5ChXJpRK9bvJuZTbRMAAAAAAEMAAB52h5ChXJpRK9bvJuZTbRMAAADQZjTAAA=

 

It is not possible to open the mail with the message id I get from the flow!

 

It is strange. It seems like it is an encoding problem.

 

I tested it with another flow for my own inbox and it worked because the message id does not contain any special characters.   

 

Regards Anja

I have the same question (0)
  • v-yamao-msft Profile Picture
    on at
    Re: Message ID in Flow unlike in Outlook Online - Encode Problem?

    Hi Anja,

     

    It might be default that Flow will generate a Message ID likes you mentioned contains “_” or “-”.

     

    There are other customers who also want to format the Message Id in a different way, please consider submitting a request at Flow ideas Forum, hope PGs will take it into considerations in the future releases. I will help collect and report it on my side.

     

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

     


    Best regards,
    Mabel Mao

     

  • Community Power Platform Member Profile Picture
    on at
    Re: Message ID in Flow unlike in Outlook Online - Encode Problem?

    Hallo Mabel,

    it's no idea. In my opionion it's a bug. Can you explain the benefit that message id in outlook online and flow should be different?

     

    Outlook online:

    AAMkADVhZDZiMTE3LTIxNDctNDljYy1hOTUxLTQ5OTViYzAyZTE3ZQBGAAAAAAD/JNp3P+taTaPKITsM2XGQBwB52h5ChXJpRK9bvJuZTbRMAAAAAAEMAAB52h5ChXJpRK9bvJuZTbRMAAADQZiyAAA=

    Flow

    AAMkADVhZDZiMTE3LTIxNDctNDljYy1hOTUxLTQ5OTViYzAyZTE3ZQBGAAAAAAD-JNp3P_taTaPKITsM2XGQBwB52h5ChXJpRK9bvJuZTbRMAAAAAAEMAAB52h5ChXJpRK9bvJuZTbRMAAADQZiyAAA=

     

    Microsoft please fix this bug.

    The only alternative I can imagine, is to make a automatic replacement of all "-" to "/" and "_" to "+". But I'm sure this workaround will fail some time and my flow doesn't work anymore.

     

    Regards Anja

  • Community Power Platform Member Profile Picture
    on at
    Re: Message ID in Flow unlike in Outlook Online - Encode Problem?

    Just for explanation my issue. 

     

    The URL from outlook online contains the encoded message id: AAMkADVhZDZiMTE3LTIxNDctNDljYy1hOTUxLTQ5OTViYzAyZTE3ZQBGAAAAAAD%2FJNp3P%2BtaTaPKITsM2XGQBwB52h5ChXJpRK9bvJuZTbRMAAAAAAEMAAB52h5ChXJpRK9bvJuZTbRMAAADQZiyAAA%3D

     

    If I decode the id, it's like this:

    AAMkADVhZDZiMTE3LTIxNDctNDljYy1hOTUxLTQ5OTViYzAyZTE3ZQBGAAAAAAD/JNp3P+taTaPKITsM2XGQBwB52h5ChXJpRK9bvJuZTbRMAAAAAAEMAAB52h5ChXJpRK9bvJuZTbRMAAADQZiyAAA=

     

    In flow the id is identicial except the "/" and "+"!

     

    Regards Anja

  • efialttes Profile Picture
    14,756 on at
    Re: Message ID in Flow unlike in Outlook Online - Encode Problem?

    Perhaps it's worth to play with decodeUriComponent expression as defined at

    https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

     

    Un-URL-escapes the string that's passed in. For example, this function returns You Are:Cool/Awesome:encodeUriComponent('You+Are%3ACool%2FAwesome') +

    Parameter number: 1 +

    Name: String +

    Description: Required. The string to decode the URL-unsafe characters from.

     

    Hope this helps

  • Community Power Platform Member Profile Picture
    on at
    Re: Message ID in Flow unlike in Outlook Online - Encode Problem?

    Hallo efialttes,

     

    I tried to use the encode url function, but nothing happend. The characters "-" and "_" won't be encoded. 

    Unfortunately my issue is still existing. I contacted microsoft support, but I'm still waiting for a solutions.

     

    As a workaround I made a compose with two replace functions. But if this problem will be fixed some time, my flow won't work anymore.

    replace(replace(triggerBody()?['Id'] , '_', '%2B'), '-', '%2F')
     
     
  • gabe17 Profile Picture
    2 on at
    Re: Message ID in Flow unlike in Outlook Online - Encode Problem?

    Hi Anja,

     

    I share your frustration, Flow should really have the option of including the OWA url as one of the dynamic fields.

     

    Would you be able to help me with setting up my flow?

     

    I get the formula you have there, but how do you combine it with the url https://outlook.office.com/owa/?viewmodel=ReadMessageItem&ItemID= ?

     

    And are you updating the task details, and adding the url to Reference Resource Link 1?

     

    I'm not good at coding and this isn't working 

    concat(https://outlook.office.com/owa/?viewmodel=ReadMessageItem&ItemID=,replace(replace(triggerBody()?['Id'] , '_', '%2B'), '-', '%2F'))
     
     
  • Verified answer
    ITCareNV Profile Picture
    574 on at
    Re: Message ID in Flow unlike in Outlook Online - Encode Problem?

    Hi everyone

     

    To people that are still facing issues with this,we have the same scenario and managed pretty easely to get it working, here is how:

     

    You can take the MessageId (completely with the = as well at the end) and use the encodeUriComponent() function to encode your messageId. After that you can insert this variable into your OWA link and have a working URL Smiley Very Happy

     

    If anyone has questions, feel free to ask. Good luck!

    Kind regards

  • Dan Profile Picture
    4 on at
    Re: Message ID in Flow unlike in Outlook Online - Encode Problem?

    This is what I'm currently doing in flow:

     

    https://outlook.office365.com/owa/?viewmodel=ReadMessageItem&ItemID=FUNCTION(encodeURIComponent)

     

    Where the FUCNTION ETC IS:

    encodeUriComponent(triggerBody()?['Id'])
     
    When using that link, I get "The attachment couldn't be opened"
    Any help would be great
  • Community Power Platform Member Profile Picture
    on at
    Re: Message ID in Flow unlike in Outlook Online - Encode Problem?

    Hi dimi,

    using the encodeUriComponent works fine for = but - and _ are still not encoded correctly. 
    Any idea what could go wrong there?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 788 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 452 Moderator

#3
developerAJ Profile Picture

developerAJ 302

Last 30 days Overall leaderboard