Using Message ID as filter

I have a string value (i.e. the message ID) and I need to be able to use this in the Filter property of the Get Outlook Mail Message activity.

How do I do it?

Can you try using “FilterByMessageIds”? If you can’t see the option, please update Mail activity package version.

Activities - Get Outlook Mail Messages -


Instead of Filter you can choose FilterByMessageIds, and you can pass your message ID as a String
That means {“MessageID”} and Try

Hope this may help you


I have already tried that - entered the string to the FilterByMessageIds but I got an error: “Value of String cannot be converted to String()”

please check this thread.

It’s expecting an array. If you have just one value, create first a new String array containing the value, and pass that instead :slight_smile:

try this by enclosing that in flower brackets like {“messageid”}



The solution worked - however the result is 0, i.e. no email in the list/array. I am using a variable inside the curly brackets, i.e. {variablename}

better check the process how you got the message id

or try getting the mails with other way and get message id and compare them

or check other properties as well


Hi @redanime94

Can you check this-

In the “Get Outlook Mail Message” activity, expand the Filter property and enter the filter expression using the string variable. The filter expression should be in the following format: "[FilterField] = 'FilterValue'". Replace [FilterField] with the appropriate field you want to filter on, such as “EntryID” or “ConversationID”. Replace 'FilterValue' with the variable name (messageId in this case).



Pleasecheck the variablename variable for data …if there are any extra characters or spaces…then it might fail

Hope this helps


Hello @Nitya1

Can you please explain this further?

So say I want to use the message ID in this instance, and the value is a variable that contains the UID or message ID, how do I construct the filter?

Hi @redanime94

if you want to filter based on the message ID, the expression would be:

"[EntryID] = '" + messageId + "'"


Is [Entry] id the exact Filter field I need to use?

What is the filter field in your case? Message ID is the filter value.

Hi @Nitya1 - have attached a snippet of the code. I have tried to put in the exact value of the message ID but it still yields zero result.

Move email.xaml (12.0 KB)

Ok - I think I got it working! Initially I was grabbing the UID instead of the Message-ID. I placed the array of string variable in the FilterByMessageIds.

Would you please mark it as solution , if your issue get resolved.

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