Errors in email automation

I have 2 errors:

Argument ‘condition’: BC30456: ‘Subject’ is not a member of ‘String’.

And

BC30311: value of type ‘String’ cannot be converted to ‘MailMessage’. The selected value is incompatible with the property type.

I’ve done everything like the lab exercise manual says. Hmm not sure how to fix this?

We can go one by one

Argument ‘condition’: BC30456: ‘Subject’ is not a member of ‘String’.

Subject’ is not a member of ‘String’: This error typically occurs when you’re trying to access a property or method called ‘Subject’ on a variable of type ‘String,’ but ‘String’ does not have a ‘Subject’ property or method. Make sure you’re operating on the correct object or type.

BC30311: value of type ‘String’ cannot be converted to ‘MailMessage’. The selected value is incompatible with the property type.

value of type ‘String’ cannot be converted to ‘MailMessage’: This error suggests that you are trying to assign a ‘String’ to a variable or property that expects a ‘MailMessage.’ You need to ensure that you are assigning the correct types. Check your code to make sure you’re using ‘MailMessage’ where it’s expected and ‘String’ where appropriate

you can try this in the if conditions

Item.Subject.Contains("resume")

or

Item.Subject.ToString.Contains("resume")

for reference you can see the screenshot

@Sara_Piana

Hi @Sara_Piana
Give
1st error

item.ToString.Subject.Contains("resume")

2nd error

item.ToString

This will solve the error.

Regards

Let me know its working or not for you

@Sara_Piana

I managed to fix the second error “item”
But I tried fixing the first error: item.Subject.Contains(“Resume”) but it’s still showing error. I tried both ways like you showed but it’s not fixing the error, so weird :thinking:

Hi @Sara_Piana

Try this syntax in If condition:

item.Subject IsNot Nothing AndAlso item.Subject.Contains("Resume")

Regards,

I tried it and this error popped up:

@Sara_Piana

Try this:

item.ToString.Subject IsNot Nothing AndAlso item.ToString.Subject.Contains("Resume")

Regards,

@Sara_Piana
Before the If condition take an assign activity and give below syntax:

Assign=> MailSubject= item.Subject
If
  MailSubject IsNot Nothing AndAlso MailSubject.Contains("resume")
Then
    //do required process
Else
    //do required process
End If

Regards

It worked! Yay thank you so much😃

1 Like

I did want to ask one thing.
So there are no errors anymore but when I clicked run this came up:

What does that mean?

You’re welcome @Sara_Piana

Happy Automation

Regards,

Make sure your credentials are right and port number and server number are also right.

Regards,

1 Like

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