user1590336
user1590336

Reputation: 109

How do I add a URL link in QnA-maker?

Does anyone know how to add URL links to the answer in QnA maker?

As it is right now I can only see that you are able to add straight text.

Upvotes: 5

Views: 5933

Answers (1)

Matthew S
Matthew S

Reputation: 308

QnA maker will always respond with a text answer, rendering links will mostly be dependent on what formats are supported for the channel in question. For example, the standard webchat control by default and used in the emulator support basic markdown formatting. So, if I wanted to render links in those, I would store my 'answer url' in markdown format and train the QnA service that way, i.e

[name of your link](https://url.com)

This answer box on stack overflow supports markdown, which i'm using to render this link.

However, different channels (facebook, slack, etc) may support different formats. If you are using your own custom webchat, you can define supported formats on your own following this guide

Knowing that the QnA service will always return a string as an answer, you should be easily able to parse/consume the string as you wish in the bot code, and have it render as a link based on what channel you're on.

Hope that helps.

Upvotes: 8

Related Questions