提问人:Pedro Azevedo 提问时间:11/15/2023 更新时间:11/15/2023 访问量:41
Teams 中的自适应卡片未在 Action.Submit 的 Input.ChoiceSet 上返回更改
Adaptive Card inside Teams not returning changes on Input.ChoiceSet on Action.Submit
问:
我的机器人上有一个过滤系统。
当我第一次应用时,我返回通过选项集上的“默认值”正确分配的新过滤器。
但是,当用户应用新的筛选器时,Microsoft 团队不会返回所选值,甚至不会返回更改的值。
在本地,Bot Framework 内部一切正常。
在javascript方面,我是这样发送的:
await context.sendActivity( {attachments: [CardFactory.adaptiveCard(adaptive_card_to_send)], attachmentLayout: "carousel"});
let system_adaptive_card = {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "New TextBlock",
"wrap": true,
"id": "system_text"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": " 👍 ",
"id": "Thumbs_up",
"tooltip": "Positive Feedback",
"data": {
"action": "FEEDBACK:Like"
}
},
{
"type": "Action.ToggleVisibility",
"title": " 👎 ",
"targetElements": [
"negative_choice",
"negative_text",
"submit_feedback"
],
"tooltip": "Negative Feedback"
},
{
"type": "Action.Submit",
"title": " 🧹 ",
"tooltip": "Reset Conversation",
"data": {
"action": "RESET"
}
},
{
"type": "Action.ToggleVisibility",
"title": " 🔎 ",
"targetElements": [
"id_1_button",
"id_2_button",
"id_3_button",
"id_4_button",
{
"elementId": "apply_filter_button",
"isVisible": false
},
{
"elementId": "id_1",
"isVisible": false
},
{
"elementId": "id_2",
"isVisible": false
},
{
"elementId": "id_3",
"isVisible": false
},
{
"elementId": "id_4",
"isVisible": false
}
],
"tooltip": "Filters",
"isVisible": "True"
}
]
}
]
}
],
"style": "emphasis"
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "Wrong Citation",
"value": "Wrong Citation"
},
{
"title": "Wrong Answer",
"value": "Wrong Answer"
},
{
"title": "Incomplete Answer",
"value": "Incomplete Answer"
},
{
"title": "Other Issue",
"value": "Other Issue"
}
],
"placeholder": "Select A Reason",
"id": "negative_choice",
"isVisible": false
},
{
"type": "Input.Text",
"placeholder": "Explain in More Detail",
"id": "negative_text",
"isVisible": false
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Send Feedback",
"data": {
"action": "FEEDBACK:Dislike"
}
}
],
"isVisible": false,
"id": "submit_feedback"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "ActionSet",
"actions": [
{
"type": "Action.ToggleVisibility",
"title": "id_1",
"targetElements": [
"id_1",
{
"elementId": "apply_filter_button",
"isVisible": true
}
]
}
],
"horizontalAlignment": "Left",
"spacing": "None",
"isVisible": false,
"id": "id_1_button"
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "1",
"value": "1"
},
{
"title": "2",
"value": "2"
}
],
"placeholder": "Placeholder text",
"isMultiSelect": true,
"id": "id_1",
"isVisible": false,
"style": "expanded"
}
]
},
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "ActionSet",
"actions": [
{
"type": "Action.ToggleVisibility",
"title": "id_2",
"targetElements": [
"id_2",
{
"elementId": "apply_filter_button",
"isVisible": true
}
]
}
],
"horizontalAlignment": "Left",
"id": "id_2_button",
"isVisible": false,
"height": "stretch"
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "1",
"value": "1"
},
{
"title": "2",
"value": "2"
}
],
"placeholder": "Placeholder text",
"isMultiSelect": true,
"spacing": "None",
"isVisible": false,
"id": "id_2",
"style": "expanded"
}
]
},
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "ActionSet",
"actions": [
{
"type": "Action.ToggleVisibility",
"title": "ID 3",
"targetElements": [
"id_3",
{
"elementId": "apply_filter_button",
"isVisible": true
}
]
}
],
"horizontalAlignment": "Left",
"id": "id_3_button",
"isVisible": false
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "1",
"value": "1"
},
{
"title": "2",
"value": "2"
}
],
"placeholder": "Placeholder text",
"isMultiSelect": true,
"isVisible": false,
"id": "id_3",
"style": "expanded"
}
]
},
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "ActionSet",
"actions": [
{
"type": "Action.ToggleVisibility",
"title": "ID 4",
"targetElements": [
"id_4",
{
"elementId": "apply_filter_button",
"isVisible": true
}
]
}
],
"horizontalAlignment": "Left",
"id": "id_4_button",
"isVisible": false
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "1",
"value": "1"
},
{
"title": "2",
"value": "2"
}
],
"placeholder": "Placeholder text",
"isMultiSelect": true,
"isVisible": false,
"id": "id_4",
"style": "expanded"
}
]
}
],
"style": "emphasis",
"bleed": true
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Apply Filter",
"data": {
"action": "APPLY FILTER",
"id_1": "{id_1.value}",
"id_2": "{id_2.value}",
"id_3": "{id_3.value}",
"id_4": "{id_4.value}"
}
},
{
"type": "Action.Submit",
"title": "Reset Filter",
"data": {
"action": "RESET FILTER"
}
}
],
"id": "apply_filter_button",
"isVisible": false
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.5"
}
答: 暂无答案
评论
json { "type": "Input.ChoiceSet", "choices": [ { "title": "1", "value": "1" }, { "title": "2", "value": "2" } ], "placeholder": "Placeholder text", "isMultiSelect": true, "spacing": "None", "isVisible": false, "id": "id_2", "style": "expanded", "value": "1,2" }