3

I'm using Azure logic apps to post a Teams message (using v3) to a channel that we have upon a trigger. When I'm trying to add a dynamic link to the content that I'm posting - it fails.

If I use an example message like below, where the SomeAction is generating a json result and the .link is a URL property:

`Example message looks like <a href="body('SomeAction').link]">this</a>`

< and > characters get encoded and I lose the clickability of the text.

Looks like in Microsoft Flow - they have an html icon button which seemingly turns off the encoding - see here: https://powerusers.microsoft.com/t5/Power-Automate-Ideas/Flow-Bot-unable-to-add-clickable-URL-to-Teams/idi-p/277965

so it looks like this: msflow_htmlbutton

but logic apps don't have the same button. If I try to add link using a static URL with the button that's provided, it works. I can't use Microsoft Flow, because it's functionalities compared to logic-apps seems to be somewhat limited.

I'm wondering if there's any way of posting a dynamic link in Microsoft Teams using logic apps?

Community
  • 1
  • 1
Mavi Domates
  • 4,262
  • 2
  • 26
  • 45
  • Did you try [SomeText](Dynamically generated URL). This work properly in almost all MS products(Logic Apps and in Flow). – Abhijit Jan 21 '20 at 10:44

1 Answers1

2

I've figured this out.

As I've said before if we just added <a href="body('SomeAction').link]"> the tags get encoded.

Turns out this encoding happens only when we add text / code through the online editor / textbox.

The trick is to navigate to Code View and ensure the encoding is removed through the arm template.

enter image description here

Mavi Domates
  • 4,262
  • 2
  • 26
  • 45