|
1 | 1 | ---
|
2 |
| -title: Building your first Bot Powered Adaptive Card Extension |
| 2 | +title: Building your first Bot Powered Adaptive Card Extension with .NET |
3 | 3 | description: Learn how to build your first Bot Powered Adaptive Card Extension using the Bot Framework for Microsoft .NET.
|
4 | 4 | ms.date: 10/30/2024
|
5 | 5 | ms.localizationpriority: high
|
6 | 6 | ---
|
7 |
| -# Building your first Bot Powered Adaptive Card Extension |
| 7 | +# Building your first Bot Powered Adaptive Card Extension with .NET |
8 | 8 |
|
9 |
| -Bot Powered Adaptive Card Extensions (ACEs) for Microsoft Viva Connections enables extending the Microsoft Viva Connections Dashboard using the Bot development model. |
| 9 | +Bot Powered Adaptive Card Extensions (ACEs) for Microsoft Viva Connections enable extending the Microsoft Viva Connections Dashboard using the Bot development model. |
10 | 10 |
|
11 | 11 | From a development point of view, a Bot Powered ACE behaves like a regular client-side ACE built with SharePoint Framework (SPFx). As such, you can render Card Views, Quick Views, you can provide properties configurable via a Property Pane, and you can implement specific behaviors to handle actions in the user interface of the ACE. You can learn more about the basics of client-side Adaptive Card Extensions for Microsoft Viva Connections by reading the tutorial ["Build your first SharePoint Adaptive Card Extension."](../get-started/build-first-sharepoint-adaptive-card-extension.md)
|
12 | 12 |
|
@@ -479,6 +479,17 @@ For example, the `TextInputCardViewParameters` instance is made of the following
|
479 | 479 |
|
480 | 480 | In the code excerpt, the images used to render the Card Views are downloaded from the web site hosted in the Bot project, and available under the **wwwroot** folder of the project. In that folder, you should upload the **Media** subfolder that you can find in the [samples folder of the reference GitHub repository](https://github.com/SharePoint/sp-dev-docs/tree/main/assets/bot-powered/Media).
|
481 | 481 |
|
| 482 | +#### Serving Card Views requests |
| 483 | + |
| 484 | +To serve the card views, you need to implement the `OnSharePointTaskGetCardViewAsync` method so that it will return the instance of the card view to collect feedback that you created in the constructor. Here follows the method implementation. |
| 485 | + |
| 486 | +```CSharp |
| 487 | +protected override Task<CardViewResponse> OnSharePointTaskGetCardViewAsync(ITurnContext<IInvokeActivity> turnContext, AceRequest aceRequest, CancellationToken cancellationToken) |
| 488 | +{ |
| 489 | + return Task.FromResult(cardViews[CollectFeedbackCardView_ID]); |
| 490 | +} |
| 491 | +``` |
| 492 | + |
482 | 493 | #### Handling user's tasks and actions
|
483 | 494 |
|
484 | 495 | When the user selects on the submit action in a Card View, the `OnSharePointTaskHandleActionAsync` method is triggered and you can handle the submission event. In the following code excerpt, you can see how the ACE collects the feedback submission.
|
|
0 commit comments