如何在Microsoft Bot框架中以表格格式显示数据 [英] How to display data in Table format in microsoft bot framework

查看:93
本文介绍了如何在Microsoft Bot框架中以表格格式显示数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮我一下以BOT显示数据表格式的情况吗

Can some one please help me out in displaying the data table format in BOT as below

推荐答案

您可以利用 ColumeSet 自适应卡中以呈现类似于卡消息的表格.

You can leverage the ColumeSet in adaptive card to render a table like card message.

例如,以下json内容将呈现为类似于卡片消息的表格:

E.G, the following json content will be renderred a table like card message:

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.0",
    "body": [
        {
            "type": "ColumnSet",
            "columns": [
                {
                    "type": "Column",
                    "items": [
                        {
                            "type": "TextBlock",
                            "weight": "bolder",
                            "text": "Name"
                        },
                        {
                            "type": "TextBlock",
                            "separator":true,
                            "text": "Apple"
                        },{
                            "type": "TextBlock",
                            "separator":true,
                            "text": "Kiwi"
                        }
                    ]
                },
                {
                    "type": "Column",
                    "items": [
                        {
                            "type": "TextBlock",
                            "weight": "bolder",
                            "text": "Tag"
                        },
                        {
                            "type": "TextBlock",
                            "separator":true,
                            "text": "Fruit"
                        },{
                            "type": "TextBlock",
                            "separator":true,
                            "text": "Fruit"
                        }
                    ]
                },
                {
                    "type": "Column",
                    "items": [
                        {
                            "type": "TextBlock",
                            "weight": "bolder",
                            "text": "Price"
                        },
                        {
                            "type": "TextBlock",
                            "separator":true,
                            "text": "2"
                        },{
                            "type": "TextBlock",
                            "separator":true,
                            "text": "1"
                        }
                    ]
                }
            ]
        }
    ]
}

在WebChat频道中,它看起来像:

in WebChat channel, it looks like:

这篇关于如何在Microsoft Bot框架中以表格格式显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆