microsoftdocs / adaptivecards Goto Github PK
View Code? Open in Web Editor NEWDocs for Adaptive Cards
Home Page: https://docs.microsoft.com/en-us/adaptive-cards/
License: Creative Commons Attribution 4.0 International
Docs for Adaptive Cards
Home Page: https://docs.microsoft.com/en-us/adaptive-cards/
License: Creative Commons Attribution 4.0 International
Is this the correct way to use it in a LUIS BOT C#?
I am getting error message that: Sorry, my bot code is having an issue. Please help!
[LuisIntent("ScheduleAnAppoitment")]
public async Task ScheduleAnAppoitmentIntent(IDialogContext context, LuisResult result)
{
var replyMessage = context.MakeMessage();
var json = await GetCardText("a");
AdaptiveCardParseResult cardParseResult = AdaptiveCard.FromJson(json);
replyMessage.Attachments.Add(new Attachment()
{
Content = cardParseResult.Card,
ContentType = AdaptiveCard.ContentType,
Name = "Card"
});
await context.PostAsync(replyMessage);
}
public async Task<string> GetCardText(string cardName)
{
var path = HostingEnvironment.MapPath($"/Cards/{cardName}.json");
if (!File.Exists(path))
return string.Empty;
using (var f = File.OpenText(path))
{
return await f.ReadToEndAsync();
}
}
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I’ve recently worked on project integrating bot to another channel using directline and handling adaptive card is the huddle at the moment.
Is there any service or future support plan for converting adaptive card to an image?
Due to the limitations of the message format supported by that channel, it is not possible to transform the contents of the adaptive card into the proper format.
I’ve checked that Facebook messenger support adaptive card by converting it to an image.
(Link: https://stackoverflow.com/questions/48313198/adaptive-cards-are-converted-to-image-in-facebook-messenger )
There is a similar discussion on stack overflow. ( https://stackoverflow.com/questions/49242790/adaptive-card-image )
Hi I'm unable to view adaptive card with multiple Input.Choice schema. I'm able to view a card with single Input.Choice schema but unable to do so for an adaptive card with multiple schema. I'm using 3 android phones. Google Pixel XL, Google Pixel 3, and Sony Xperia XZ1. The cards work fine with iPhones.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Hi guys,
What does coming "soon" mean? Over a year has passed since there was an update on native styling for UWP. Thanks in advance for any hints!
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Are adaptive cards supported by teams? If not, what will it be?
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Is the Render2Image available anywhere? From what I can see the webpage doesn't exist anymore.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Is it please possible to show the full code to implement the code in UWP and timeline?
This code has unknown variables. Thanks, Dennie
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I have been using AdaptiveCard on Facebook Messenger, using the rendered image, but now it's not working properly all of a sudden. The rendered image is not clickable and has a zoom that doesn't allow it to be seen in it's totality. Any idea on why this started happening?
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Angular w/ typescript
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Hi,
I'm diving in developing a Bot with MS Teams channel, my bot will be deployed both on PC and mobile Teams app. However, when I intended to create a card which allows users to pick a date time, then I have no idea with it. I've searched a lot about Adaptive Cards and O365 Connector Cards, but only O365 Connector Card work for me because Adaptive cards are only supporting in Dev Preview version at present.
I just wondered when Adaptive card supports for MS Teams? It will really helps me a lot.
Thanks in advance! :)
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I'm doing a service app which will gather data from SQL and send an AC but I've been told to put the script in the head tag however how can I show the body html BEFORE the adaptive card because when in the head, I can't have the card after the html.
why I'm asking is because the customer wants to read the detail of the approval BEFORE going on and click Approve or Reject
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The bullet list and numbered list do not render as described in web chat or in bot framework emulator. The number or bullet is not shown and spacing is not correct.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Excuse me but i can't use the adapatative card for my Bot in teams. Return ERROR 400 Bad Request. Why this ? This adaptative card works in Bot framework emulator
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
This page has said "Coming soon" for nearly a year. PLEASE create the documentation soon!
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Have you ever used the ability for Docs to share markdown content between pages? I feel like our SDKs table would be a great use case for doing that, versus copy/pasting it everywhere. We also have “Learn more” on many pages that I just copy-paste. Would be cool if we could author and update that in one place and all the pages benefit.
For example, on Getting Started – Bots, we have Platform SDKs which is outdated. Should prob just show our standard SDK table here and link to the SDKs page?
Speaking of the SDKs page, do you think we should add an Overview file to the SDK root? Which would show a unified table of SDKs? Are we currently showing that table anywhere? The one with install badges, build badges, etc
Other thoughts, the thing I love about google’s card docs is heavy use of images paired for the text.
E.g., our first example card shows JSON and no idea of what it renders as, leaving that as an exercise for the reader.
https://review.docs.microsoft.com/en-us/adaptive-cards/authoring-cards/getting-started?branch=master#example-card
Other thought: we could also add a Try it Yourself to all JSON payloads. I wonder if that’s easy to create a Docs control that does that automatically?
We should file an issue to improve the Extensibility page with maybe a JSON snippet of an extended card and a sample C# or JS showing it?
Last thought, there is some good content buried under “Resources” – any thoughts on how we could maybe surface that content better without hiding it under a pretty generic term?
Is it a known issue that base64 image is not rendering on WPF client? if yes then lets know when this issue will be fixed and if no please share the solution.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
This page needs to be updated.
(4/30/18)
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Instead of rendererdCard.Warnings; it must be renderedCard.Warnings;
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Hi Team,
When will AdaptiveCards be available in Skype for Business?
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Would it be possible to provide a code sample on UWP client to demonstrate how the adaptive card be rendered? Thanks.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Max and min attributes are not working with adaptive card in microsoft teams,
I am using node sdk
This markdown feature in - Hyperlinks Title doesn't seem to work in bot framweork emulator
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
We are implementing the adaptive carousel cards. We have noticed that when the user clicks on the navigation arrows left or right multiple times that the slide function visually stops between 2 cards. Has this been addressed?
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
for vscode the reference should be https...
{
"$schema": "https://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": []
}
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I'm developing a chat bot, using MS Teams as a channel on both desktop app and mobile app. I also use MS Bot Framework, which have supported Adaptive Cards already. Everything just worked smoothly until 30' ago, i did updated the latest version of MS Teams on iOS device. Then, selectAction property of my Adaptive Cards didn't work anymore.
I think maybe MS had a mistake while releasing this version.
Could anyone help me, or to raise this issue on MS teams at least?
Thanks in advance!
Would .NET HTML rendering also apply to Razor page of MVC?
Would it be possible to provide a code sample on .NET HTML client to demonstrate how the adaptive card be rendered? Thanks.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I am trying to use adaptive cards in a waterfall scenario to get a decision from the user. How can I use the adaptive card in prompts to parse the entered data? I use the "Action.Submit" action to send the data from the adaptive card to the bot. This dcoumentation (https://docs.microsoft.com/en-us/healthbot/scenario-authoring/adding-cards#getting-data-from-forms) talks about using the adaptive card in a prompt but I can't seem to leverage the sparse information. Thank you!
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
When I click "talk to our Scuba Bot" link, I navigate to new link however embeded webUI for chat is not working.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Hi Guys,
The binary for iOS has about 30MB in size, while in Android it's about 5MB.
Do you know why is that, can we reduce the size to a same level?
Thanks,
Fan
Here we have "Example: Parse an AdaptiveCard from JSON", but there's no information about how I can change the parsed card values. If I load the JSON schema taken from the Adaptive Cards Designer (https://adaptivecards.io/designer/), the values there are just sample values from the Designer. I need to change them. Maybe I could find an element by its id, but how?
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I get it, the library is originally for Objective-C, but I find the usage for Swift quite confusing. For instance, I don't understand the importing of the library inside my controller, and since I can't do that, I'm unable to see if my code is actually working (spoiler: it isn't compiling either).
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Very disappointed that although there is support for Android/Java and iOS/Swift, there is no support for Xamarin.Android, Xamarin.iOS or Xamarion.Forms. As Xamarin is a Microsoft technology, it should have been supported out of the box from day 1. Instead for Xamarin developers, this is just a specification to define a visual object in JSON, which we have to deserialize and then create a complete custom renderer from scratch.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
We have a need to have HTML detail information of approval first then a card to accept or reject and this multiple times in one single email so we don't have to send one card in 10 emails that the boss needs to approve. Is that possible because I can't find any information about it.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
We're very interested in Actionable Messages in particular, but also Adaptive Cards in Teams. Our back-end systems are Java, so a templating engine based around Apache Velocity would be great for us.
With regards to front-end development we currently use AngularJS, and will be upgrading to Angular in the near future - but we are open to implement ReactJS too.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Most of the elements say that "type" is not required - is this correct? i.e. How can you create a TextBlock if you do not set the type to "TextBlock"?
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Hello Everyone,
I need to know when Adaptive Cards is supported for MS Teams (NodeJS).
Now the state is "Coming Soon".
Does anyone know when the state is "coming soon"?
Thanks 👍
Seems the schema in this article is out of date. The newer one is at https://github.com/Microsoft/AdaptiveCards/blob/master/samples/v1.0/HostConfig/sample.json.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I would like an element for containing meta data. This element would be ignored by a render, but could be used by bots to modify or enhance behavior. For example, I want a citation notice in the card about the card itself (and other Dublin Core see http://www.ietf.org/rfc/rfc5013.txt ).
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
https://github.com/Microsoft/AdaptiveCards/blob/master/samples/v1.0/HostConfig/sample.json is not found mentioned for sample HostConfig json
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Is there a way to build adaptive cards "on the fly"? I am looking for a way to display user input to the user in a more aesthetic way than just sending a text message like:
"Your profile:
Name: John Doe
Age: 30
Profession: Student"
When we change a property in the right pane for an object, let say an Action.OpenURL, nothing changes in the view until we go in the json payload and just change something there will trigger a refresh of the preview. It would be good to make sure that the preview shows exactly what we change regardless where we change it.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The Bot is ContosoScuba, in following code sample, after render, renderedAdaptiveCard.FrameworkElement = null, no matter either generate card by .FromJson() or .FromJsonString(). Please comment on how to generate var card. Thanks.
//This method is responsible for handling messages from bot:
async Task ReadBotMessagesAsync(DirectLineClient client, string conversationId)
{
var renderer = new AdaptiveCardRenderer();
//You can optionally set watermark - this is last message id seen by bot
//It is for paging:
string watermark = null;
while (true)
{
//Get all activities returned by bot:
var activitySet = await client.Conversations.GetActivitiesAsync(conversationId, watermark);
watermark = activitySet?.Watermark;
//Extract the activies sent from our bot.
var activities = from x in activitySet.Activities
where x.From.Id == botId
select x;
//Iterate through all activities:
foreach (Activity activity in activities)
{
// Extract each attachment from the activity.
foreach (Attachment attachment in activity.Attachments)
{
switch (attachment.ContentType)
{
// Display a adaptive card.
case "application/vnd.microsoft.card.adaptive":
if (attachment.Content != null && !string.IsNullOrEmpty(attachment.Content.ToString()))
{
string jStr = attachment.Content.ToString();
var card = AdaptiveCard.FromJsonString(jStr);
var renderedAdaptiveCard = renderer.RenderAdaptiveCard(card.AdaptiveCard);
if (renderedAdaptiveCard.FrameworkElement != null)
{
myGrid.Children.Add(renderedAdaptiveCard.FrameworkElement);
}
}
break;
}
}
}
await Task.Delay(TimeSpan.FromSeconds(2)).ConfigureAwait(false);
}
}
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Can we have a new input type for password type of fields. It can be helpful to get the user credentials directly from the bot itself.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
What are the 'types' I can override the rendering of besides TextBlock? Is it based on the Card Schema? Can I override the Action Button rendering?
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
When do you guys expect the adaptive cards to be ready on skype? got a couple of customers that saw it interesting and the limitation found was the unavailability on skype.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
There are several interesting presentation scenarios that could be achieved with card that embeds some website. This would not necessarily have to allow embedding of any website, but instead gradually add support for more popular ones (e.g. YouTube, Twitter, PowerBI etc.)
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
See HostConfig and ShowActionMode
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Can we add an object in card scope for metadata that would be ignored by renderers but could be used by hosts for behavior extensions?
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
This documentation doesn't say anything about how to override any behavior or rendering, i.e., what exactly do you have to do to, say, change which DOM elements are used.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.