Is there a way to give the ChoiceSet a dynamic array of choices in an adaptive card? - adaptive-cards

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. 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. I am writing the adaptive card on https://adaptivecards.io/designer/
here is an example of what I want:

Here is the way to do this:
Set the array in this way, each value has title and value as choices:
And from the adaptive card, in the ChoiceSet, call it this way:

Related

How to assign a dynamic value to input List property in angular

I want to render multiple dropdowns in angular based on the result from api.
From the api 2 dropdown controls are returned with different data however my code shows same data for both of the controls
Can anyone suggest how to assign a dynamic value to the property "list" in the input element?. I think if that is possible my problem would be solved or please let me know if there is any other solution
As list is an input attribute not a property, you can assign dynamic value to list using:
[attr.list] ='object.property'.
for more info see the issue

Adaptive Cards : Highlighting Dates in Date Input

Hi using adaptive cards on my chatbot ui, i have a Adaptive card of "type": "Input.Date".When the user opens up the date panel, i need to high light few dates based on custom logic. is that something that adaptive cards implementation supports. I have a specific scenario where input.date selection should be used to pre-filter input.time as part of the same card.
That is not currently supported in the property set of the Input Date element
http://adaptivecards.io/explorer/Input.Date.html
You should request this as a feature on the GitHub site:
https://github.com/Microsoft/AdaptiveCards/issues

adaptive cards : how to pass values and influence content on Show Card action from main card?

I have an adaptive card which has multiple input controls. and instead of submit I have show Details button on clicking of which I need to show the details based on inputs provided. Is there a way to refer to the values dynamically and show the content of the details cards based on what is chosen in the main card?
No, that is not possible.
The ShowCard contains the entire JSON payload of another complete card and since the cards are declarative, rather than dynamic, you need to know the ShowCard payload at the time you create the original JSON

How to storage data from a html popup?

I created a pop up with html with a list of answer. I need to store the answer selected by the user and then display the result in a dynamic infographic. What's the best way to storage the answer and display them in a dynamic infographic? Thanks
The best way is to get the value from the popup by JavaScript and store it into a variable

ListView add more items in Metro apps?

I have a metro application in which I have a Listview and service data contains above 100 items. Initially when am loading listview in my page it has to display only 8 items plus 1 more-related item and later if i click on a more-item it needs add another 9 items to my page and totally it has to show 17 items in my page and need to display more item also like that flow continues.What should I get to get my scenario.Can anyone help me.Below I tried to give u my scenario.
Thank you.
Take a look to this article: http://www.silverlightplayground.org/post/2012/06/10/Metro-Incrementally-load-GridView-and-ListView-with-ISupportIncrementalLoading.aspx.
There are a couple of solutions -- all depending on the work that you want to undertake. Also, I would suggest that you don't have a "More" button if you can help it -- it's not the best user interaction. Option 2 is going to give you the best experience.
Option 1
Use WinJS.Binding.List as your data source -- using this you can manipulate it like a JavaScript Array (e.g. push, pop etc). As you add & remove items from the list, the list view will react to those changes.
Full details are here.
Option 2
Create a VirtualDataSource derivation that is intimately aware of the ways in which you can request your data, and can offer up a consistent interface to the ListView. This enables your UI to be completely flexible to it's layout, and request enough data to satisfy the available space, while virtualizing the UI elements (better memory/performance), and the data (ensuring only the data needed by the user is requested.
Full worked example here.