最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

botframework - Mobile version of MS-Teams doesn't fully render adaptive card - Stack Overflow

programmeradmin2浏览0评论

Gave a look into quite some forums/questions already but the answers were never able to solve my issue. Adaptive cards worked perfectly well with the old webhooks but I just can't figure out what I'm doing wrong when using workflow.

I've set up a presumably working workflow which parses the json received from a webhook request and then sends the adaptive card into a teams channel. The adaptive card is correctly being displayed in the desktop version, but the mobile version only displays the title.

I've tried changing the "type" to "message" instead of "AdaptiveCard", but using the type "message" doesn't even render anything on the mobile version, it just shows that a user has sent something but without any content. Changing the "version" property also doesn't affect anything.

Desktop:

Mobile:

My adaptive card json looks like this:

{
    "type": "AdaptiveCard",
    "$schema": ".json",
    "version": "1.4",
    "msteams": {  
        "width": "Full"  
    },  
    "body": [{
        "type": "TextBlock",
        "text": "Uptime Monitor",
        "wrap": true,
        "fontType": "Monospace",
        "size": "ExtraLarge",
        "weight": "Bolder",
        "color": "Attention",
        "style": "heading"
    }, {
        "type": "Table",
        "columns": [{
            "width": "auto"
        }, {
            "width": "auto"
        }, {
            "width": "auto"
        }],
        "rows": [{
            "type": "TableRow",
            "cells": [{
                "type": "TableCell",
                "items": [{
                    "type": "TextBlock",
                    "text": "URI",
                    "wrap": true,
                    "fontType": "Monospace",
                    "color": "Default"
                }],
                "style": "warning"
            }, {
                "type": "TableCell",
                "items": [{
                    "type": "TextBlock",
                    "text": "Down since",
                    "wrap": true,
                    "fontType": "Monospace",
                    "color": "default"
                }],
                "style": "warning"
            }, {
                "type": "TableCell",
                "items": [{
                    "type": "TextBlock",
                    "text": "Downtime (mins)",
                    "wrap": true,
                    "fontType": "Monospace",
                    "color": "default"
                }],
                "style": "warning"
            }],
            "style": "warning"
        }, {
            "type": "TableRow",
            "cells": [{
                "type": "TableCell",
                "items": [{
                    "type": "TextBlock",
                    "text": ";,
                    "wrap": true,
                    "horizontalAlignment": "Left",
                    "spacing": "None",
                    "fontType": "Monospace",
                    "size": "Medium",
                    "color": "Attention",
                    "isSubtle": false
                }],
                "style": "attention"
            }, {
                "type": "TableCell",
                "items": [{
                    "type": "TextBlock",
                    "text": "24.01.2025 10:39:19",
                    "wrap": true,
                    "fontType": "Monospace",
                    "color": "Attention"
                }],
                "style": "attention"
            }, {
                "type": "TableCell",
                "items": [{
                    "type": "TextBlock",
                    "text": "5",
                    "wrap": true,
                    "fontType": "Monospace",
                    "color": "Attention"
                }],
                "style": "attention"
            }]
        }]
    }]
}

In case needed, this is the schema I generated using "Use sample payload to generate schema" within power automate:

{
    "type": "object",
    "properties": {
        "type": {
            "type": "string"
        },
        "$schema": {
            "type": "string"
        },
        "version": {
            "type": "string"
        },
        "msteams": {
            "type": "object",
            "properties": {
                "width": {
                    "type": "string"
                }
            }
        },
        "body": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "type": {
                        "type": "string"
                    },
                    "text": {
                        "type": "string"
                    },
                    "wrap": {
                        "type": "boolean"
                    },
                    "fontType": {
                        "type": "string"
                    },
                    "size": {
                        "type": "string"
                    },
                    "weight": {
                        "type": "string"
                    },
                    "color": {
                        "type": "string"
                    },
                    "style": {
                        "type": "string"
                    },
                    "columns": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "width": {
                                    "type": "string"
                                }
                            },
                            "required": [
                                "width"
                            ]
                        }
                    },
                    "rows": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "type": {
                                    "type": "string"
                                },
                                "cells": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "type": {
                                                "type": "string"
                                            },
                                            "items": {
                                                "type": "array",
                                                "items": {
                                                    "type": "object",
                                                    "properties": {
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "text": {
                                                            "type": "string"
                                                        },
                                                        "wrap": {
                                                            "type": "boolean"
                                                        },
                                                        "fontType": {
                                                            "type": "string"
                                                        },
                                                        "color": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "type",
                                                        "text",
                                                        "wrap",
                                                        "fontType",
                                                        "color"
                                                    ]
                                                }
                                            },
                                            "style": {
                                                "type": "string"
                                            }
                                        },
                                        "required": [
                                            "type",
                                            "items",
                                            "style"
                                        ]
                                    }
                                },
                                "style": {
                                    "type": "string"
                                }
                            },
                            "required": [
                                "type",
                                "cells"
                            ]
                        }
                    }
                },
                "required": [
                    "type"
                ]
            }
        }
    }
}
发布评论

评论列表(0)

  1. 暂无评论