How can I return a sharepoint webpart into the chat from Teams Conversation bot in Teams App?

40 Views Asked by At

We are implementing azure bot in our organization's Teams app. So far we have done all registrations and other steps on Azure portal and we are having a functional bot in Teams' "Chat" section. Our bot's logic is implemented in .NET. However, we also have multiple SharePoint webparts also created in our organization that we access from Apps' section. My query is that "can we send a webpart directly from our bot in the current chat. i.e., if an user asks for a report to the bot in the teams chat, the bot will return the entire report's webpart into the current chat and not just any AdaptiveCard or anything."

As a workaround I am returning buttons with url that redirects the browser to the webpart. But we want to return the actual webpart in the cuurent chat.

1

There are 1 best solutions below

0
vikram-MSFT On

To return a SharePoint web part into the chat from a Teams Conversation bot in a Teams app, you can use the Task Module capability in the Teams platform.

var taskModuleRequest = new

{

task = new

{

    type = "continue",

    value = new

    {

        title = "SharePoint Web Part",

        url = "https://contoso.sharepoint.com/sites/my-site/my-page.aspx",

        width = "medium",

        height = "medium"

    }

}

};