简体   繁体   English

我可以在 msteams 自适应卡的 Input.ChoiceSet 中添加动态输入吗? 我正在从 api 调用中获取值并希望作为输入列出

[英]Can i add dynamic input in Input.ChoiceSet in msteams adaptive card? I am getting values from an api call and want to list as an input

I am getting some data from an API call and I want to display them in an adaptive card as a choice set, then the user will be able to choose one or more choices to do action on them.我从 API 呼叫中获取一些数据,我想将它们显示在自适应卡中作为选择集,然后用户将能够选择一个或多个选项来对它们执行操作。 The problem is that the array of choices is dynamic.问题是选择数组是动态的。 My question is how to pass an array to the choice set in the adaptive card.我的问题是如何将数组传递给自适应卡中的选择集。 Statically i can do.静态我可以做到。 Since its dynamic, I tried via choices.data, but in vain由于它是动态的,我尝试通过 choices.data,但没有成功

That is not possible as such, the card is static and can't "retrieve" data.这是不可能的,该卡是 static 并且无法“检索”数据。 You have to pass all available choices into the JSON payload of the card.您必须将所有可用选项传递到卡的 JSON 负载中。

In MS Teams however you can do this in multiple steps.但是,在 MS Teams 中,您可以分多个步骤执行此操作。 In the first card the user selects the first option and submits the card.在第一张卡片中,用户选择第一个选项并提交卡片。 Then you can send a second card with choices according to the first card.然后你可以发送第二张卡片,根据第一张卡片进行选择。

To my knowledge that's the only way to achieve what you want currently据我所知,这是实现您当前想要的唯一方法

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM