-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to create a Table in AdaptiveCard #205
Comments
Thanks for providing that reference link. At present that support is not present in this package. When AdaptiveCard support was initially implemented I do not believe that schema version 1.5 was supported (for incoming webhook connectors). It has been a while since I last tested however. I'll test and report back when I'm able. |
It looks like schema 1.5 is officially supported: I took the JSON payload example from https://adaptivecards.io/explorer/Table.html and added it to an {
"type": "message",
"attachments": [
{
// Table element payload here
}
]
} Complete JSON payload example: Teams webhook connector payload{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"contentUrl": null,
"content": {
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.5",
"body": [
{
"type": "Table",
"gridStyle": "accent",
"firstRowAsHeaders": true,
"columns": [
{
"width": 1
},
{
"width": 1
},
{
"width": 3
}
],
"rows": [
{
"type": "TableRow",
"cells": [
{
"type": "TableCell",
"items": [
{
"type": "TextBlock",
"text": "Name",
"wrap": true,
"weight": "Bolder"
}
]
},
{
"type": "TableCell",
"items": [
{
"type": "TextBlock",
"text": "Type",
"wrap": true,
"weight": "Bolder"
}
]
},
{
"type": "TableCell",
"items": [
{
"type": "TextBlock",
"text": "Description",
"wrap": true,
"weight": "Bolder"
}
]
}
],
"style": "accent"
},
{
"type": "TableRow",
"cells": [
{
"type": "TableCell",
"style": "good",
"items": [
{
"type": "TextBlock",
"text": "columns",
"wrap": true
}
]
},
{
"type": "TableCell",
"style": "warning",
"items": [
{
"type": "TextBlock",
"text": "ColumnDefinition[]",
"wrap": true
}
]
},
{
"type": "TableCell",
"style": "accent",
"items": [
{
"type": "TextBlock",
"text": "Defines the table's columns (number of columns, and column sizes).",
"wrap": true
}
]
}
]
},
{
"type": "TableRow",
"cells": [
{
"type": "TableCell",
"style": "good",
"items": [
{
"type": "TextBlock",
"text": "rows",
"wrap": true
}
]
},
{
"type": "TableCell",
"style": "accent",
"items": [
{
"type": "TextBlock",
"text": "TableRow[]",
"wrap": true
}
]
},
{
"type": "TableCell",
"style": "attention",
"items": [
{
"type": "TextBlock",
"text": "Defines the rows of the Table, each being a collection of cells. Rows are not required, which allows empty Tables to be generated via templating without breaking the rendering of the whole card.",
"wrap": true
}
]
}
]
}
]
},
{
"type": "Table",
"gridStyle": "accent",
"firstRowAsHeaders": true,
"showGridLines": false,
"columns": [
{
"width": 1
},
{
"width": 1
},
{
"width": 3
}
],
"rows": [
{
"type": "TableRow",
"cells": [
{
"type": "TableCell",
"items": [
{
"type": "TextBlock",
"text": "Name",
"wrap": true,
"weight": "Bolder"
}
]
},
{
"type": "TableCell",
"items": [
{
"type": "TextBlock",
"text": "Type",
"wrap": true,
"weight": "Bolder"
}
]
},
{
"type": "TableCell",
"items": [
{
"type": "TextBlock",
"text": "Description",
"wrap": true,
"weight": "Bolder"
}
]
}
],
"style": "accent"
},
{
"type": "TableRow",
"cells": [
{
"type": "TableCell",
"style": "good",
"items": [
{
"type": "TextBlock",
"text": "columns",
"wrap": true
}
]
},
{
"type": "TableCell",
"style": "warning",
"items": [
{
"type": "TextBlock",
"text": "ColumnDefinition[]",
"wrap": true
}
]
},
{
"type": "TableCell",
"style": "accent",
"items": [
{
"type": "TextBlock",
"text": "Defines the table's columns (number of columns, and column sizes).",
"wrap": true
}
]
}
]
},
{
"type": "TableRow",
"cells": [
{
"type": "TableCell",
"style": "good",
"items": [
{
"type": "TextBlock",
"text": "rows",
"wrap": true
}
]
},
{
"type": "TableCell",
"style": "accent",
"items": [
{
"type": "TextBlock",
"text": "TableRow[]",
"wrap": true
}
]
},
{
"type": "TableCell",
"style": "attention",
"items": [
{
"type": "TextBlock",
"text": "Defines the rows of the Table, each being a collection of cells. Rows are not required, which allows empty Tables to be generated via templating without breaking the rendering of the whole card.",
"wrap": true
}
]
}
]
}
]
}
]
}
}
]
}
then saved it to a file (e.g., #!/bin/bash
webhook_url="https://outlook.office365.com/webhook/a1269812-6d10-44b1-abc5-b84f93580ba0@9e7b80c7-d1eb-4b52-8582-76f921e416d9/IncomingWebhook/3fdd6767bae44ac58e5995547d66a4e4/f332c8d9-3397-4ac5-957b-b8e3fc465a8c"
curl \
-X POST \
-H "Content-type: application/json" \
-d @/tmp/table-test.json \
"${webhook_url}" It arrived without issue in the specified Teams channel. I borrowed the sample webhook connector URL for illustration purposes. No estimates for implementation, but at least we know that feature is now supported by incoming webhook connectors. |
Based on current documentation and brief testing, schema version 1.5 appears to now be supported by Teams Incoming Webhook Connectors. refs GH-205
Using https://adaptivecards.io/designer/, I selected "Target version" of 1.5 and "host app" of Microsoft Teams and got this warning:
as shown here: Not sure if receiving the generated table in my testing yesterday was a fluke (possible), or if the Adaptive Cards Designer warning logic is outdated (more likely?). Probably best to assume that the warning logic is outdated for now based on the initial test results. EDIT: I ran into the same thing back when the |
The more I look into this, the more this is beginning to look like a v3 feature. The earlier design (mistakenly?) attempted to simplify logic by heavily extending the "base"
By incorporating (shoehorning?) fields for those Adaptive Card elements into the go-teams-notify/adaptivecard/adaptivecard.go Lines 488 to 490 in 4ca48fd
While we could name the new Going to work with this further, but this is not encouraging. |
Follow-up: I dug further and found a way to do this. It's not exactly ideal, but should work with the current library design. I've got a lot on my plate right now, so it may be some time before the first alpha release is available to test the new support. |
OVERVIEW Add early implementation of Adaptive Card Table support. CHANGES - Expand base/shared Element type with fields specific to the Table type - Refresh documentation for Column type to note that it serves a dual role - member of a ColumnSet - member of a Table (TableColumnDefinition) - Add new types specific to tables - Examples - add example of manually creating a table - add example of creating a table with headers - add example of creating a table of unordered "grid" values - README - Add references to new examples - Add Table element documentation reference LIMITATIONS Support for Adaptive Card Table elements is new. There are likely sharp edges and missing support. Feedback is welcome. REFERENCES - refs GH-205 - https://adaptivecards.io/explorer/Table.html
Initial support is available for preview: #220. Examples are available. Pending no significant issues being found, I hope to merge it and tag as an alpha release in the weeks ahead. Feedback is welcome. |
No feedback received. Will proceed with merging the initial supported added by #220. |
OVERVIEW Add early implementation of Adaptive Card Table support. CHANGES - Expand base/shared Element type with fields specific to the Table type - Refresh documentation for Column type to note that it serves a dual role - member of a ColumnSet - member of a Table (TableColumnDefinition) - Add new types specific to tables - Examples - add example of manually creating a table - add example of creating a table with headers - add example of creating a table of unordered "grid" values - README - Add references to new examples - Add Table element documentation reference LIMITATIONS Support for Adaptive Card Table elements is new. There are likely sharp edges and missing support. Feedback is welcome. REFERENCES - refs GH-205 - https://adaptivecards.io/explorer/Table.html
No feedback received thus far. Going ahead with releasing the changes in the next stable release. We can further refine the implementation based on any future feedback. |
Hi, I was wondering if we can create a table https://adaptivecards.io/explorer/Table.html using this package, if not any plans on including it?
The text was updated successfully, but these errors were encountered: