我正在尝试寻找一种方法,让用户检索,编辑和发布表中的多个数据。像这样:
对此有任何支持吗?任何指导表示赞赏。
答案 0 :(得分:2)
您可以使用自适应卡为用户提供一个“表格”以进行填写。并非所有通道都支持自适应卡,但是支持的通道列表正在不断增加。有关更多信息,请参见:https://adaptivecards.io/和howto: send-an-adaptive-card
以下是 MS团队的示例:
可以使用Adaptive Cards库创建该卡,也可以从.json文件中加载该卡,如下所示:
string cardPath = Path.Combine(_hostingEnvironment.WebRootPath, "testcard.json");
string cardText = File.ReadAllText(cardPath);
var card = AdaptiveCards.AdaptiveCard.FromJson(cardText);
var reply = turnContext.Activity.CreateReply("card");
reply.Attachments.Add(new Attachment()
{
Content = card.Card,
ContentType = AdaptiveCards.AdaptiveCard.ContentType
});
await turnContext.SendActivityAsync(reply);
注意:当用户提交卡片时,activity.Value将包含一个.json值字符串:
示例卡片.json:
{ “ $ schema”:“ http://adaptivecards.io/schemas/adaptive-card.json”, “ type”:“ AdaptiveCard”, “ version”:“ 1.0”, “身体”: [ { “ type”:“ TextBlock”, “ text”:“告诉我们您自己...”, “ weight”:“ bolder”, “ size”:“大” }, { “ type”:“ TextBlock”, “ text”:“我们只需要更多细节即可为您预订一生的旅程!”, “ isSubtle”:是的, “ wrap”:正确 }, { “ type”:“ TextBlock”, “ text”:“不用担心,我们绝不会分享或出售您的信息。”, “ isSubtle”:是的, “ wrap”:是的, “ size”:“小” }, { “ type”:“ TextBlock”, “ text”:“您的名字”, “ wrap”:正确 }, { “ type”:“ Input.Text”, “ id”:“ firstlast”, “占位符”:“最后,第一”, “ style”:“文字”, “ separataion”:“无” }, { “ type”:“ TextBlock”, “ text”:“您的电子邮件”, “ wrap”:正确 }, { “ type”:“ Input.Text”, “ id”:“电子邮件”, “占位符”:“ youremail@example.com”, “ style”:“ email”, “ separataion”:“无” }, { “ type”:“ TextBlock”, “ text”:“电话号码” }, { “ type”:“ Input.Text”, “ id”:“电话”, “占位符”:“ xxx.xxx.xxxx”, “ style”:“ tel” } ], “动作”:[ { “ type”:“ Action.Submit”, “ title”:“发送”, “数据”:{“ personalInfo”:“”} } ] }