cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anja
Level: Powered On

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

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=AAMkADVhZDZiMTE3LTIxNDctNDljYy1hOTU...

 

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=AAMkADVhZDZiMTE3LTIxNDctNDljYy1hOTU...

 

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

1 ACCEPTED SOLUTION

Accepted Solutions
dimi
Level 10

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

View solution in original post

8 REPLIES 8
Community Support Team
Community Support Team

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 Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anja
Level: Powered On

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

Anja
Level: Powered On

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

Dual Super User
Dual Super User

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




Each time you kudo any of our inspiring answers...
an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! It's for free!




Proud to be a Flownaut!






Highlighted
Anja
Level: Powered On

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
Level: Powered On

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'))
 
 
dimi
Level 10

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

View solution in original post

Dan
Level: Powered On

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

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (5,001)