Dynamic data Binding in Adaptive cards - adaptive-cards

I am looking for a way where I can bind the dropdowns used in adaptive cards with the data that I will get from my API.
Anyone know how to use https get calls in adaptive cards to prefill data.
Thanks

I'm pretty sure you can't do -inside- the card itself (i.e. from the user's bot client), but it's easy enough to dynamically create the card -before- you send it to the user. There are 3 ways I know of to do this:
1) you can compose the json string for the card yourself, and build up the dynamic options
2) you can using a strongly-typed library to create the card, and build the options dynamically in code (e.g. if you're using C#, you can use this nuget package.
3) you can look at the new adaptive card templating (currently in preview).
I discuss these options more over here: Display number in adaptive card

Related

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. 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
That is not possible as such, the card is static and can't "retrieve" data.
You have to pass all available choices into the JSON payload of the card.
In MS Teams however you can do this in multiple steps.
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

Modal showing Dynamic nested Json data and synchronized with dynamically created buttons (generic ID)

I am developing an interactive web application with ASP.NET Core MVC.
The application consists of reading several items of data from a JSON file, nested in the following way:
Communities --> People --> People data
I have already developed the model, the controller and the view, and I am able to show a grid containing the names of the people available in the JSON file, using this technique from NewtonSoft :
string json = webClient.DownloadString(#"MyJson.json");
model.RootObjects = JsonConvert.DeserializeObject<Rootobject>(json);
My question: I would like to add a popup/window, upon clicking one of the buttons/data cells that contain the person name in the grid.
Upon clicking the modal must show further information from the same Json file that has been used to build the Main Grid (in the index) .
The complexity that I am facing (As I am really new to this kind of dev) is : having multiple dynamic buttons (created from the Json data) then synchronizing between the ID of the button (Or Data cell) and the Specific information being read again from the JSON and returned to the model.
I have tried a lot of solutions which I have found on different websites, I have seen JQuery, AJAX . Tried to build another model for a partial view, but in vain .
I only need some suggestions from your experience. What is the best that you could do in this kid of situations?
Should I go again through developing a new model in my ASP.NET Core MVC and reinvent the wheel? Should I go through pure AJAX, jQuery ...etc ?

Print Table In Bot emulator whose fields contain class object values

I want to print a table in Bot Emulator. The table contains values from a class object. What is the best way to do it?
I tried to do it using Adaptive card but I am stuck in printing variable values( class objects) as I cannot pass the objects parameter to my Json file made for adaptive card.
Two-column tables can be included in Adaptive Cards as fact sets.
If you need more than two columns, just make each row in your table its own column set.
Pretty sure your best approach might be using Adaptive cards, it shouldn't be that hard to load your card's properties before sending it as attachment as it's shown in MBF docs:
.NET: Add rich cards: Adaptive card
Node.js: Send rich cards: Send an Adaptive Card
Both links shows you how to send an adaptive card, using that, you may be able to create methods that parse your object to card's properties

how can I override the data that is rendered on shopify .liquid with the need for using Ajax

I have a use case where I want to implement custom search functionality for a Shopify site. So instead of using getting a JSON with Ajax and making a html and replacing the html. Is there a way where I can override the search.results data that the .liquid files are using.
So when I make a search in /search?q=xyz, I want to get the data from my API, and use that data to render the product-item.liquid. This way I don't have to worry about the UI of the product-item for different themes.
Yes. You can easily do this. You would install an App in your shop, and create an endpoint you would call with your search criteria. The end point is handled by a Shopify App Proxy, that securely allows you to callback the App. You could return Liquid as results, or just JSON as you wish. It is a standard and simple pattern for you to use.
See here: https://help.shopify.com/api/tutorials/application-proxies

GWT JSON based client side (multiple one on top the other) draggable data charts

Using GWT on the client side and .NET C# on the server with JSON being the data transport. I would like to send a collection of data points and associated info tip data to the browser/client for multiple data types and I am looking for some client side charting library that would specifically support the following:
Draw a line graph for each collection of data points per data type one on top of the other (i.e. one in a row for each data type).
Be able to click n drag all the charts (together) just like google maps without seening a break in the line graph as long as there is data on either side of the timeline
Be able to manipulate click event on the chart to request further detailed info from the server for the time (to show in a pop up)
I am currently constructing the bitmaps/tiles on the server, store them in a temporary store in memory and then send them to the browser which is I suppose would not be scalable when the number of clients grow and also it is very slow/inefficient.
Any suggestions will be highly appreciated.
There are several client side charting tools with wrappers for GWT.
Here is a list of charts which have gwt wrappers and support line charts:
google-chart-tools (gwt wrapper)
dygraphs
Highcharts JS (gwt wrapper)
Alternatively you could implement your charts also with a charting framework:
Protovis (gwt-wrapper)
Almost all above mentioned charting libraries should support requirement 1 (stacked data) and 3 (interaction) For requirement 2 (drag and drop support) you probably have to do it yourself or extend the charting libraries.