Search code examples
botframeworkmicrosoft-teams

Some links from botframework do not open in MS Teams


I want to display an adaptative card with an openUrl action to a sharepoint page.

The sharepoint url contains some filters and looks like : https://xxx.sharepoint.com/sites/main/Recherche/results.aspx?k=Annee:'2018' AND Group:'test'

From Teams client on windows, clicking on the team doesn't work at all (no action)

On web client, it opens a new teams on the source conversation I clicked the link on.

It probably comes from specials chars and encoding (stripping the last part after the colon make it work) but I didn't find the proper encoding to work with the full link.

BTW, the full link works in Bot Emulator and Skype for Business.


Solution

  • I'm not sure what encoding you tried, but the : characters in the URL are causing the problem because they aren't allowed. There's no way for me to test this, but if you call encodeURI on the string and set that as the value of url it should work:

    encodeURI("https://xxx.sharepoint.com/sites/main/Recherche/results.aspx?k=Annee:'2018' AND Group:'test'")

    returns

    "https://xxx.sharepoint.com/sites/main/Recherche/results.aspx?k=Annee:'2018'%20AND%20Group:'test'"