Teams 中的自适应卡片未在 Action.Submit 的 Input.ChoiceSet 上返回更改

Adaptive Card inside Teams not returning changes on Input.ChoiceSet on Action.Submit

提问人:Pedro Azevedo 提问时间:11/15/2023 更新时间:11/15/2023 访问量:41

问:

我的机器人上有一个过滤系统。

当我第一次应用时,我返回通过选项集上的“默认值”正确分配的新过滤器。

但是,当用户应用新的筛选器时,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"
}
BotFramework Microsoft-Teams 自适应卡

评论

0赞 Meghana-MSFT 11/15/2023
我们最后检查了这一点,当我们检查 ID1-i.stack.imgur.com/1c572.png 中的 1 和 2 时,它返回了正确的值 i.stack.imgur.com/PkaZy.png。我们也尝试了相同的重置过滤器,在 ID3 中重置 1 - i.stack.imgur.com/sUrJa.png,i.stack.imgur.com/aVINd.png
0赞 Pedro Azevedo 11/16/2023
如果需要,我们可以安排讲座。请按照以下步骤操作: 1. 选择 3 个过滤器并应用。2. 发送消息让机器人回答。3. 再次应用另一个过滤器(或移除一个过滤器)。4.它将随机取消选择过滤器。
0赞 Pedro Azevedo 11/16/2023
因此,请尝试使用一些已经设置的默认值并应用过滤器。例如: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" }
0赞 Meghana-MSFT 11/23/2023
我们尝试通过设置默认值来设置。如果我们为所有按钮设置默认值“1,2”,Microsoft 团队不会返回所选值,甚至不会返回更改的值。但是,如果选择任何 1 个值作为默认值,则工作正常。默认值 - i.stack.imgur.com/dRtDk.png。更新过滤器,然后单击“应用 - i.stack.imgur.com/pOrTD.png”。只有 button2 值正确更新 - i.stack.imgur.com/z9x9v.png。按钮 1、2 和 4 值未正确返回,因为这两个值都是默认选择的。您能否确认您是否指的是相同的问题?

答: 暂无答案