Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

338
Views
MS Teams Bot -- Is it possible to invoke a botMessagePreview from a task/submit activity as opposed to from a composeExtension/submitAction activity?

I am building a messaging extension in Teams that uses task modules and sends adaptive cards.

I want to invoke the same task module from both a messaging extension command and from a button on an adaptive card that is sent to the user.

The intended flow through the application is the following:

End user launches a task module containing a react page by clicking a messaging extension command under the compose box -> user finds an object in the task module -> user clicks an 'export to chat' button on the react page -> microsoftTeams.tasks.submitTask() is triggered on the react page -> task module closes -> in the bot activity handler handleTeamsMessagingExtensionSubmitAction returns a botMessagePreview like shown here -> user is able to preview the adaptive card and can send it as a message from the bot to the chat.

The adaptive card contains a button "View Object":

   {
      type: "Action.Submit",
      title: "View Object",
      data: {
        msteams: {
          type: "task/fetch",
        },
        goToUrl: url,
      },
    }

From the adaptive card, I am able to invoke a task module, but this time I have to use handleTeamsTaskModuleFetch instead of handleTeamsMessagingExtensionFetchTask. This means that once the end user submits the task module they will not see the botMessagePreview because that functionality seems to be exclusive to the messaging extension. Is there any way I can work around this?

So far I have tried duplicating my logic from the messaging extension handlers in handleTeamsTaskModuleFetch and handleTeamsTaskModuleSubmit but I haven't found a way to avoid side effects that crash my app or a way to display the botMessagePreview.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This seems to be not possible to invoke a botMessagePreview from a task/submit activity.

botMessagePreview functionality is not supported for task/submit activity.

This functionality supported in Messaging extension.

Ref Doc: https://docs.microsoft.com/en-us/microsoftteams/platform/resources/messaging-extension-v3/create-extensions?tabs=typescript

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!