web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Copilot Studio - Bot Extensibility
Unanswered

Adaptive Cards - Bot Framework Handling

(1) ShareShare
ReportReport
Posted on by 39
Hi there, 

I'd appreciate some help. I've created a custom web app front end to communicate to a Copilot Studio agent via Direct Line. 

The back end handling has been created in Botframework C#.net

We've been able to get Adaptive Cards created in Copilot Studio to render correctly in the front end app, however we're struggling to be able to handle the submit action of the card and post it back to Copilot Studio. 

Has anyone been able to achieve this? If so, I'd greatly appreciate some help or guidance. 

Current code to handle the invoke of the card:
protected override async Task<InvokeResponse> OnInvokeActivityAsync(ITurnContext<IInvokeActivity> turnContext, CancellationToken cancellationToken)
{
   if (turnContext.Activity.Name == "adaptiveCard/action")
   {
       var submitData = turnContext.Activity.Value;  
       _logger.LogInformation("AdaptiveCard submit: {Data}", JsonConvert.SerializeObject(submitData));
       await RelayToCopilotStudioAsync(submitData, cancellationToken);
       return new InvokeResponse { Status = 200 };
   }
   return await base.OnInvokeActivityAsync(turnContext, cancellationToken);
}
Create activity to post back as a message:
 
var outgoing = Activity.CreateMessageActivity();

outgoing.ChannelId = "directline";

outgoing.Conversation = new ConversationAccount(id: _directLineConversationId);

outgoing.Value = submitData;

await _directLineClient
   .Conversations
   .PostActivityAsync(_directLineConversationId, (Activity)outgoing, cancellationToken);


 
Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    47,123 Super User 2025 Season 2 on at
    Adaptive Cards - Bot Framework Handling
     
    Can you please be specific in what your issue is. I will take a look at your code, but just want to be clear on the exact issue you are having.
     
    Cheers
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 468 Super User 2025 Season 2

#2
stampcoin Profile Picture

stampcoin 52 Super User 2025 Season 2

#3
trice602 Profile Picture

trice602 46 Super User 2025 Season 2

Featured topics