Monday, April 1, 2024

Adaptive card Post for ATC communication

How to add Hyperlink to adaptive cards

https://stackoverflow.com/questions/67618020/how-to-add-hyperlink-to-adaptive-cards

{ "type": "TextBlock",
"text": "Check out [Adaptive Cards](https://adaptivecards.io)"
}

https://adaptivecards.io/explorer/RichTextBlock.html

https://adaptivecards.io/explorer/TextBlock.html

{

"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "medium",
"weight": "bolder",
"text": "Your Response Matters",
"style": "heading",
"wrap": true
},
{
"type": "TextBlock",
"text": "",
"color": "Attention",
"style": "heading",
"wrap": true
},
{
"type": "TextBlock",
"size": "medium",
"weight": "bolder",
"text": "Please refer to below link and take appropriate action",
"style": "heading",
"wrap": true
},

{ "type": "TextBlock",
"text": "Check out [Adaptive Cards](https://adaptivecards.io)"
}

],

"actions": [
{
"type": "Action.ShowCard",
"title": "Keep Rule",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "Input.Date",
"label": "Enter the rule expiry date",
"id": "acExpiryDate1"
},
{
"type": "Input.Text",
"id": "acKeepRuleComment",
"isMultiline": true,
"label": "Justification"
}
],
"actions": [
{
"type": "Action.Submit",
"id": "keep",
"title": "OK"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
},


{
"type": "Action.ShowCard",
"title": "Discard Rule",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "Input.Text",
"id": "acDiscardComment",
"isMultiline": true,
"label": "Add a comment"
}
],
"actions": [
{
"type": "Action.Submit",
"id": "discard",
"title": "OK"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
},

{
"type": "Action.ShowCard",
"title": "Make Rule Permanent",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "Input.Date",
"label": "Enter the rule expiry date",
"id": "acExpiryDate"
},
{
"type": "Input.Text",
"id": "acMakeRulePermanentComment",
"isMultiline": true,
"label": "Justification"
}
],
"actions": [
{
"type": "Action.Submit",
"id": "permanent",
"title": "OK"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
},

{
"type": "Action.ShowCard",
"title": "Not sure, setup a quick call with NSA team",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "Input.Text",
"id": "acNotSureComment",
"isMultiline": true,
"label": "Please provide your concerns on this rule?"
}
],
"actions": [
{
"type": "Action.Submit",
"id": "NotSure",
"title": "OK"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
},

{
"type": "Action.ShowCard",
"title": "Redirect to alternate POC",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "Input.Text",
"id": "acEmailID",
"isMultiline": false,
"label": "Email ID"
}
],
"actions": [
{
"type": "Action.Submit",
"id": "Redirect",
"title": "OK"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
}

],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.4"
}


I managed to fix the problem by addingthe textblock  { "type": "TextBlock", "text": "Check out [Adaptive Cards](https://adaptivecards.io)" } in the Card Paylod Editor on https://adaptivecards.io/designer/ .

https://powerusers.microsoft.com/t5/Building-Flows/adding-hyperlinks-to-adaptive-card-message/td-p/645215

https://powerusers.microsoft.com/t5/Building-Flows/Adaptive-Card-Error-Invalid-Json/m-p/503222#M62924

No comments:

Post a Comment

Building Secure Azure AI Foundry Agents with Managed Identity

  The credential problem nobody wants to own Every team that connects an Azure AI Foundry agent to Microsoft Graph, SharePoint, Outlook, or...