我正在尝试从V4 nodejs bot中查找处理自适应卡提交操作的示例。我查找了repo示例,它们都具有操作类型action.OpenUrl。我正在尝试找到如何处理action.submit从AD卡,并在瀑布步骤中处理它。
- ]
- "操作":[
- {
- "type":"Action.Submit">
- "title":"提交此项">
- }
- ]
您需要将data
属性作为Action.Submit
的一部分。data
属性可以是任何值。但是,如何发送值决定了它是以imBack
(用户可见(还是postBack
(用户不可见(的形式显示。
此外,如果包含指向Action.Submit
的输入字段,则这些字段中的数据将被读取到data
属性中,该属性可以省略(可选(。请参阅此示例以获取演示。
imBack-发送活动中的data
值,并向用户显示"Submitted"(类型:string(
"data": "Submitted"
postBack-发送活动中的data
值,但不向用户显示(类型:键/值对(
"data": { "value": "Submitted" }
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "Present a form and submit it back to the originator"
},
{
"type": "Input.Text",
"id": "firstName",
"placeholder": "What is your first name?"
},
{
"type": "Input.Text",
"id": "lastName",
"placeholder": "What is your last name?"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Action.Submit",
"data": {
"value": "Submitted"
}
}
]
}
希望得到帮助!