Get outlookmail activity-subject

i need to pass variables (subject) from excel,where i have given my condition in if

config i need to pass my condition in term of row(0).to string format any suggestions? thanks in advance

@priyankavivek Use send outlook mail message activity and in the body property pass excel row variable

yes can i knw how to pass the variable in if condition?

@priyankavivek,

As per my understanding, you need to pass subject of your mail based on the requirement. Am i right?

You can do these steps :

  1. Add all the data of excel to a dictionary
  2. Then pass the subject based on the requirement as Dictionary(“Your subject Key”) …
  3. It will be easy to get the required subject at required time instead of checking all the rows of excel data…

@priyankavivek Can you specify why you are trying to pass if condition?

Buddy
usually in if condition we can pass any variable in a form of EXPRESSION only and the output of that expression should be a BOOLEAN value
so we can pass the value from excel like how you mentioned row(“subjectcolumnname”).ToString but it must be equated to any value with a conditional operator like this
item.Subject.ToString.Equals(row(“Subjectcolumnname”).ToString)
can i have a view on the that full loop activity a screenshot if possible

cheers @priyankavivek

I am having three kinds of subject , i need to pass these as a variable in if condition using OR operator. And those subject , attachment only i need to save.
How to pass subject as variable?
Am getting that variable from value from excel

Hope this will help @priyankavivek,

  1. Getting all the messages from outlook
  2. storing the excel in data table
  3. looping through all the messages
  4. Looping through data table subjects and checking if they match or not …

You can do that in vice versa also.

First loop through the excel rows and check the mail subject matches the excel data

1 Like

getting an error
i have given the condition like
item.subject = config(0)(2).tostring or item.Subject = row(1)(1).tostring
but the error i got is implicit conversion from string to boolean. any suggestions?

what are you trying to do with this?

Can you change that to row(“column Name”).tostring …

Column Name is the column heading in excel …

If config is also a data table, then do one thing …

  1. loop through both the data tables and assign the values to two different variables.
  2. then try to check the values as item.subject = variable1 or item.subject = variable2 within the loop of messages

image

trying with or conditions

Can you explain a bit?

trying with OR conditions

Use this as a reference… may be it has the entire things you need to do…
DataTablesAndExcel.xaml (8.2 KB)

@priyankavivek …

Does this solve your issue @priyankavivek,

Let me know if you have any doubts

1 Like

iam trying now will share if any problems still exist thankyou

Sure… @priyankavivek

Close the topic once you are done