SOLVED

[Bot Builder 4.0 SDK] Teams Task module not showing up HTML page

Copper Contributor

I am trying to load an HTML page using the task module, as suggested under

https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/what-are-task-modul...

When the user clicks an action button, the task module opens up but HTML is not getting loaded inside it.

 

"actions": [
        {
            "type": "Action.Submit",
            "title": "dasdas",
            "data": {
                "msteams": {
                    "type": "task/fetch"
                },
                "data": "dasdas"
            }
        }
    ]

 




Screenshot 2023-04-21 at 12.03.48 AM.png
Getting error as "Unable to reach app. Please try again."

Using the below code I am trying to set the HTML page.

 

 
const htmlPageUrl = 'https://637c-27-7-******.ngrok-free.app/error.html';
await context.sendActivity({
    value: {
      status: 200,
      body: {
        task: {
          type: 'continue',
          value: {
            title: 'My Page',
            height: 400,
            width: 600,
            url: htmlPageUrl,
          },
        }
      },
    },
    type: 'invokeResponse'
   });

 

 
If I use the below code snippet, then the error "Unable to reach app. Please try again." is not seen but the popup is empty.

 

 await context.sendActivity({
    value: {
      status: 200,
      body: ''
    },
    type: 'invokeResponse'
   });

 

Screenshot 2023-04-21 at 12.14.36 AM.png

 

Please share any pointers to get it working.

Thank you.

1 Reply
best response confirmed by Prasad_Das-MSFT (Microsoft)
Microsoft Verified Best Answer
Solution

The issue is resolved, the issue was happening as we were using HTTP module.  (const http = require('http'


Which did have methods like r
es.status and res.send, so the response was not being sent from function processActivityunder under botFrameworkAdapter.ts. 

After we used express issue was resolved.

1 best response

Accepted Solutions
best response confirmed by Prasad_Das-MSFT (Microsoft)
Microsoft Verified Best Answer
Solution

The issue is resolved, the issue was happening as we were using HTTP module.  (const http = require('http'


Which did have methods like r
es.status and res.send, so the response was not being sent from function processActivityunder under botFrameworkAdapter.ts. 

After we used express issue was resolved.

View solution in original post