简体   繁体   English

在 Composer 中使用自适应卡片作为输入表单的任何示例?

[英]Any examples of using Adaptive Card as Input Form in Composer?

Are there any examples in Composer using an adaptive card input form (such as https://adaptivecards.io/samples/InputForm.html ) and how to retrieve the information into the design flow? Composer 中是否有使用自适应卡片输入表单(例如https://adaptivecards.io/samples/InputForm.html )的示例以及如何将信息检索到设计流程中?

All the examples I've seen so far as for formatting output data to the user.到目前为止,我看到的所有示例都用于将输出数据格式化给用户。

The sample adaptive card collects name, email, & phone number.示例自适应卡收集姓名、电子邮件和电话号码。 The form displays fine in Composer.该表单在 Composer 中显示良好。

How do you use this form to collect information in Composer?您如何使用此表单在 Composer 中收集信息? There is no obvious way to use adaptive cards except as an output option.除了作为输出选项之外,没有明显的方法可以使用自适应卡。 来自 Composer 的快照

Unfortunately, there isn't a great way to do this at the moment.不幸的是,目前没有很好的方法来做到这一点。 Adaptive Card responses come in via Activity.Value instead of the "normal" Activity.Text .自适应卡片响应通过Activity.Value而不是“正常”的Activity.Text进来。 So, you just need to create a switch in the Unknown Intent trigger that watches for this.因此,您只需要在 Unknown Intent 触发器中创建一个监视此事件的开关。

  1. If condition, Condition: turn.activity.value && !turn.activity.text如果条件,条件: turn.activity.value && !turn.activity.text
  2. On the True branch, Send a response: - '@{turn.activity.value}'在 True 分支上,发送响应: - '@{turn.activity.value}'

That takes care of the adaptive card part.这负责自适应卡部分。 The trick is getting it to trigger something else if turn.activity.value && !turn.activity.text is false.如果turn.activity.value && !turn.activity.text为假,则诀窍是让它触发其他东西。 For that, I have it launch a separate dialog on the False branch (which is a simpler copy of the RespondingWithCards sample):为此,我让它在False分支上启动一个单独的对话框(这是 RespondingWithCards 示例的简单副本):

图片

See this GitHub issue for more information.有关更多信息,请参阅 此 GitHub 问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 检查是否在自适应卡中填写了输入表格 - Check if an input form is filled in, in a Adaptive Card 从输入表单自适应卡中检索数据 - Retrieve data from input form adaptive card 自适应卡片 Bot Framework composer - Adaptive card Bot Framework composer 检查是否在自适应卡片机器人框架 c# 中填写了输入表单 - Check if an input form is filled in a Adaptive Card bot framework c# 使用bot框架node.js v4 Facebook原生模板是否支持Input form Adaptive card - Whether Input form Adaptive card is supported by native template of Facebook using bot framework node.js v4 自适应卡在提交时清除输入 - Adaptive Card clears input on submit 如何使用自适应卡添加RTF输入框? - How to add a RTF input box using adaptive card? 如何使用 Composer 对话框读取在 Bot 自适应卡中选择的 Bot 对话框中的选择集值 - How to read choiceset values in Bot dialog that are selected in Bot adaptive card using Composer dialog 如何在机器人框架作曲家中使用带有按钮的自适应卡发送 email? - How can I send an email using an adaptive card with button in bot framework composer? BotFramework V4 nodejs 中的自适应卡片(用户输入表单)在用户提交后得到重新提示 - Adaptive card(user input form) in BotFramework V4 nodejs gets reprompted after user submit
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM