Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

335
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda