How to convert any Variable to string? UIPath.Slack.Model.Message[]

Hello Community!

Using Slack Activities I can retrieve a message from a Slack channel and display it as string using ‘For Each item’ and VB expression ‘item.Text.ToString’ as shown in 1st screenshot. The variable type is UIPath.Slack.Model.Message and converts to string OK.

However if I try the same setup but change the Get Message source from Slack Channel to Direct Message then I get the compile error ‘Option Strict On disallows late binding’

Variable type is still UIPath.Slack.Model.Message

I think I need to know how to convert the variable type UIPath.Slack.Model.Message into a string using another VB code expression?

1 Like

Hey @Cameron_Pirrie

Could you please show the screenshot of that error.

Thanks
#nK

Yes - thanks for your response

Error is attached it is a compiler error

GetMessage Setup2 Error

1 Like

Hey @Cameron_Pirrie

Are you sure on the cam message data type and also hope you got auto suggestion from UiPath on the item.Text just to confirm its all right

#nK

That’s not the entire error message. Mouse over the red icon and it’ll show you the entire message including what it’s trying to convert.

Hello!

Attached is the full message which is very similar - any thoughts?

1 Like

Hey @Cameron_Pirrie

Please share your project zip here.

Thanks
#nK

OK thanks - So I did have the CamMessage TypeArgument set incorrectly.

It was set to Object, it is now corrected to UiPath.Slack.Model.Message and there are no errors!

However - when I test the activity it will run successfully but it will not show the messages still.

1 Like

Hey @Cameron_Pirrie

Okay that should be something related to the activity internal functionality.

Thanks
#nK

It contains API keys that I cannot share. If I create a copy without the keys would that be of use?

Ok thanks! How would I go about resolving that?