I am getting an response from chat bot . Those response contains URL links. I want to replace those link with hyperlink before sending the message to user . How can i do that ?
I am aware of this
[Link Text](Link URL)
This will not work as URL link changes as well .
Here you can find an example. It takes the generative answer and transforms it into URI components. With that we can identify a value to split the answer and the hyperlink. In the next steps we transform the answer back into a proper string and then we concat all blocks together, using the PVA markup syntax [Link Desc.](Link) . This should just show the concept, the solution is really static. E.g. it does not support multiple links and it uses ": " to split Text and URL. But the result is what you were asking for 🙂
If this solves your problem it would be great if you can mark this as the solution for your problem. Let me know if it works out for you.
As suggested by @stuermer, I would indeed explore using a Power Fx formula to manipulate the generated answer variable before sending it to the user, and if not possible in Power Fx, I would explore the same using a cloud flow.
One approach would be to that every URL title could be same like "Support Docs"
Another approach would be that i cut few sections form Url(like the last word ) and use it as title
In the properties of the "Create generative answers" Action you can un-check the option that the Bot automatically post a message. What you can do instead is to create an action and pass the Answer Variable to Power Automate and try to do some trim / replace expression magic and transform the links into [Link Description](Link URL) Formats. After that you can pass that answer back into the Bot. Or you can try if you can achieve something similar with PowerFX right from PVA canvas.
What should be the title of these URLs?
I want to have hyperlinks to those URL in response , as those Big url do not look good .
So I am getting the links from "Create generative answers " block, and I don't want Url in my response , instead i want hyperlinks to those url
Hi @pathfinder1729,
If you're saying the links are dynamic, then use a Power Fx formula to have Markdown URL formatting + dynamic values stored in variables.
Example:
"[" & Topic.URLName & "](" & Topic.URL & ")"
Henry
Hey @pathfinder1729!
Is the URL link part of a topic or do you get the link from a Power Automate action?