Apr 06 2021 10:52 AM - edited Apr 06 2021 11:02 AM
EDIT: It seems to work if you manually generate a Share URL in OneNote, but not with whatever is in the address bar. Leave it to MS to break something as simple as a working copy/paste URL...
When using Action.OpenUrl in an adaptive card to Teams, if a OneNote/Sharepoint URL is used, it doesn't seem to work. I suspect it's breaking due to having the "{" and "}" in the URLs.
This works fine
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "Don't forget to update your notes for the team meeting"
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "Update Notes",
"url": "https://google.com"
"
}
]
}
This does not work
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "Don't forget to update your notes for the team meeting"
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "Update Notes",
"url": "https://redacted.sharepoint.com/sites/redacted/_layouts/15/Doc.aspx?sourcedoc={redacted}&action=edit"
"
}
]
}
I'm posting this card using the Post Adaptive Card to Chat or Channel action in Power Automate. I've also tried wrapping the URL in a encodeUrlComponent function, to no avail.
Apr 09 2021 03:53 AM
SolutionHi @plmcgrn, The sharepoint/OneNote Url should be in encoded format. If URL has '{' and '}' it does not work. Please replace '{' with '%7B' and '}' with '%7D' respectively it will work.
Sample URL:
https://{domainName}.sharepoint.com/:w:/r/teams/My_Test/_layouts/15/Doc.aspx?sourcedoc=%7BF2B5321E-7CA9-468D-B628-8ECB9308F982%7D&file=Document.docx&action=default&mobileredirect=true
Apr 12 2021 04:28 AM - edited Apr 12 2021 04:31 AM
@plmcgrn Please let us know if your issue has been resolved.
Sep 15 2022 09:16 PM
Apr 09 2021 03:53 AM
SolutionHi @plmcgrn, The sharepoint/OneNote Url should be in encoded format. If URL has '{' and '}' it does not work. Please replace '{' with '%7B' and '}' with '%7D' respectively it will work.
Sample URL:
https://{domainName}.sharepoint.com/:w:/r/teams/My_Test/_layouts/15/Doc.aspx?sourcedoc=%7BF2B5321E-7CA9-468D-B628-8ECB9308F982%7D&file=Document.docx&action=default&mobileredirect=true