Get Outlook Mail Activity - variable in filtering subject


Can I pass a variable into the filter option of the get outlook mail activity. What is working now is hardcoded below. Thanks.

“@SQL=” + “”"" + “urn:schemas:httpmail:subject” + “”"" + " like ‘%hello world%’"


Try this:

“@SQL=urn:schemas:httpmail:subject LIKE '%”+variableName.Tostring+"%’ "


wow. thanks man, I will try and let you know.

1 Like

Hi @lakshman

It’s working! Thanks.

May I know if it will also work if I read the variable from excel. For very row, it’s different subject. Then issue the variable in the row.item format? Eg.
“@SQL=urn:schemas:httpmail:subject LIKE '%” + row.Item(1).ToString + “%’”

Thanks !

1 Like

you were almost done
you need to mention like this buddy if you are getting from a excel with for each row loop

“@SQL=urn:schemas:httpmail:subject LIKE '%” + row(“Columnname”).ToString + “%’”


“@SQL=urn:schemas:httpmail:subject LIKE '%” + row(1).ToString + “%’”

where 1 is the column index which usually starts with 0

Cheers @Kindergarden


Thanks @Palaniyappan.

I got it. May I also know why the below-mentioned works
emailList.Count.ToString > row.Item(2).ToString
but this one emailList.Count.> row.Item(2) does not work as I am comparing number value.


Because both are different type of variables.

1 Like

Also, what if I have a shared mailbox ? How do I indicate this is the MailFolder opion instead of hardcoding “inbox”?

you are trying to compare a integer value and string
i.e., the emaillist.Count is of type integer as count gives us numerical value
and row.Item(2) gives us string value
as the > operator can’t be used with string and more over the two operands must be of same type…and as these two things are missing here in the expression you were not able to compare

and if you want to include shared mail box
you can mention like this in folder property
sharedmaill email id/Inbox/Foldername

this could help you on this

Cheers @Kindergarden

did that work buddy @Kindergarden

Thanks @Palaniyappan

I see. That means if I have a shared mailbox called ‘GroupA Meal Mailin’ and a folder ‘lunch’, then I should indicate in MailFolder as “GroupA Meal Mailin/lunch” right ?

I suppose I also could input “GroupA Meal Mailin/lunch” in excel and input in MailFolder as row.Item(3).ToString as a variable ?

1 Like

that should be a mail id…
yah you can pass with a variable @Kindergarden

Thanks. I have posted another request for help and tinker you guys. Please help check it out too. In the meantime, I will check out the shared mail box.

hi @Palaniyappan

I thought i read somewhere one could have multiple filter condition. Please advise if my syntax is correct. I would like to add From to tighten the filter but it failed below.

“@SQL=urn:schemas:httpmail:subject LIKE '%” + row.Item(0).ToString + “%’” and “urn:schemas:httpmail:from LIKE ‘%MrABC%’”

Hi @Palaniyappan

The variable in folder does not work. I input row(3).ToString.

Tried to input excel as inbox which is default also won’t work. The shared mailid in the format GroupA Meal Mailin/lunch similarly also doen’t work.

Both instances error on The Specified Folder does not exist. Strange right? I think I read somewhere too that it’s possible to pass in folder as variable but now sure about row.item though.

Hi @Palaniyappan,

The variable for folder is working now. But it’s not working for shared mailbox. Even when I hardcode the value “GroupA Meal Mailin/lunch” into the folder, it still run into error Specified Folder does not exist. Any idea if really shared mail id is support in the Mail Folder input of Get Outlook Mail activity?

1 Like

it should be mail id , kindly refer this post


Hi @Palaniyappan

I browse through and it seems no solution as yet. Is that what u r trying to sugegst ?

Also, u mnetioned should be mail ID as in I should enter “GroupA Meal Mailin” in Account input instead and lunch in MailFolder ?

1 Like

mention in folder as “Inbox/lunch”
and try @Kindergarden

Thanks @Palaniyappan

Got it. I created variable for shared mailbox under Account. And the variable for folder under MailFolder. So, the confusion is with Account. Good that we share here. Thanks man !

1 Like