UiPath MS Teams automation - Send Message - insert hyperlink

Hi there,
I’m using a Microsoft Teams Scope activity, and inside it Get Chats activity and Send Message activity. These activities function as they should. However, when I try to insert a hyperlink to the Message, I’m getting either plain text in MS Teams, or outright error in Studio.

For example for this code

I’m getting

I’ve tried multiple variations, like using “” and ‘’ at various places, omitting td elements and working with only a element, to no avail.

Furthermore, when I try to set BodyType property to HTML or BodyType.HTML I end up getting another error. Since this is optional, I omit it in my steps, but maybe it’s also worth noting
image
image

Any advice how to insert hyperlink to the Send Message activity appreciated.

1 Like

Hey @samuel.janoska ,

Please pass as below,

For BodyType : BodyType.Html

For Body : "<a href="uipath.com">Your hyperlink</a>"

Please make sure you include quotes for body value as it expects a string.

Thanks
Nithin

Hi Nithin,
thank you for such a prompt answer. However, in this point I am getting the same results as described in my original query.
When using our example, I am getting this:


If I modify quotations mark to this:

“<a href='uipath.com”>My hyperlink’"

then a message is sent in MS Teams with exactly the same case as before, it is sent as text.

Furthermore, if I try to use BodyType.Html, I am getting the same error as before:
image

1 Like

Hey @samuel.janoska ,

Thanks for trying it.

It’s my bad that I missed the quotes part in hyperlink, Glad that you solved it :slight_smile:

You may also escape double quotes to resolve it.

Coming to body type, could you please try the below…

Microsoft.Graph.BodyType.HTML

Hope this helps.

Thanks
Nithin

1 Like

Thanks Nithin.

I’m getting the error also with

Microsoft.Graph.BodyType.HTML

image
Upon entering just

HTML

I’m getting following:
image

1 Like

Hey @samuel.janoska ,

Could you please do the following,

image

Navigate to the project dependencies, Right-click and import namespaces.

Thanks
Nithin

I’m still getting the ‘ambiguous’ error.

I noticed this: Microsoft.Graph.Core is appearing twice. Could this be a problem?

image

1 Like

It’s same for me and working. That shouldn’t be a problem.

Have you got auto suggestion when you tried typing Microsoft.Graph.BodyType

Yes, I do, and the description goes

Enum Microsoft.Graph.BodyType

1 Like

Yep, Please don’t include enum…

I confirm I’m entering it without enum, but am receiving the above described issue with ambiguity.

1 Like

Okay, cool.

Let’s try a different approach.

  1. In the BodyType property field → Ctrl + k - Create a new variable. It will auto create with type assigned.

  2. In the BodyType property field → .Html

Could you please try this approach.

!! Html should be title case, and it shouldn’t be uppercase.

#nK

1 Like

Thanks, it works!

image

image

Kind Regards,
Samuel

1 Like

If you don’t mind @samuel.janoska,

Just curious to know is the HTML case was the issue or you declared a new variable.

Of course. The HTML case does not seem to be the issue here - I tried multiple solutions before and none were working. The declaration of the variable seems to have helped.

In fact, I’ve just tried using var_bodyType.HTML and it works the same way as var_bodyType.Html.

1 Like

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