Type ahead search does not work from Task Module
Version
Adaptive Card - 1.5 "botbuilder": "~4.14.0",
Describe the bug
I need to implement a scenario where type ahead search makes a call to my remote api and fills in the choice list. This works fine the if adaptive card is sent directly in the chat. But this not work inside if the adaptive card is sent in the task module.
To Reproduce
Steps to reproduce the behavior:
Following is the message which is sent for adaptive card
const card = CardFactory.adaptiveCard({
type: 'AdaptiveCard',
body: [
{
type: 'RichTextBlock',
inlines: [
{
type: 'TextRun',
text: 'Test',
weight: 'bolder',
},
{
type: 'TextRun',
text: 'Test',
}
],
separator: parseInt(index) === 0,
spacing: parseInt(index) === 0 ? 'extraLarge': 'default',
},
{
title: 'Update',
type: 'Action.Submit',
data: {
msteams: {
type: 'task/fetch'
},
id: 'Upate Id',
buttonText: 'Update',
}
}
],
$schema: 'http://adaptivecards.io/schemas/adaptive-card.json',
version: '1.5',
})
Following is card which is sent in task module
const card = CardFactory.adaptiveCard({
$schema: 'http://adaptivecards.io/schemas/adaptive-card.json',
version: '1.5',
type: 'AdaptiveCard',
body: [
{
"columns": [
{
"width": "stretch",
"items": [
{
"choices": [
{
"title": "Static Option 1",
"value": "static_option_1"
},
{
"title": "Static Option 2",
"value": "static_option_2"
},
{
"title": "Static Option 3",
"value": "static_option_3"
}
],
"isMultiSelect": false,
"style": "filtered",
"choices.data": {
"type": "Data.Query",
"dataset": "npmpackages",
"testkey": "harkirat"
},
"id": "choiceselect",
"type": "Input.ChoiceSet"
}
],
"type": "Column"
}
],
"type": "ColumnSet"
}
],
actions: [
{
type: 'Action.Submit',
title: 'Save',
data: {
privateMeta,
replyToId
}
}
]
});
Following is the onActivityInvoke code:-
async onInvokeActivity(context: TurnContext): Promise<InvokeResponse<any>> {
if (context.activity.name === 'task/fetch') {
const result = await this.handleTeamsTaskModuleFetch(context, {
replyToId: context.activity.replyToId,
data: context.activity.value.data
});
return {
status: 200,
body: result
}
}
if (context.activity.name == 'application/search') {
const successResult = {
status: 200,
body: {
"type": "application/vnd.microsoft.search.searchResponse",
"value": {
"results": [
{
"value": "FluentAssertions",
"title": "A very extensive set of extension methods"
},
{
"value": "FluentUI",
"title": "Fluent UI Library"
}
]
}
}
}
return successResult;
}
}
Note that the activityInvoke function is not called when I enter the search text in my input box. However, if I send this card directly i.e without task module and directly in chat it works just fine.
Expected behavior
Type ahead search should work from Task Module
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Tracking Status
Dotnet SDK TODO
- [ ] PR
- [ ] Merged
Javascript SDK TODO
- [ ] PR
- [ ] Merged
Python SDK TODO
- [ ] PR
- [ ] Merged
Java SDK TODO
- [ ] PR
- [ ] Merged
Samples TODO
- [ ] PR
- [ ] Merged
Docs TODO
- [ ] PR
- [ ] Merged
Tools TODO
- [ ] PR
- [ ] Merged
@harkiratsaluja, I'll be attempting a repro of this and will come back with a result and any questions.
@stevkan Adding to the above, I tried to check the error message in ms teams web and it gives me error 504: Bot is not installed on type ahead search from task module.
Hey @stevkan just wanted to check if you need any help from my end in debugging or reproducing the issue?
@harkiratsaluja, I see that there is a duplicate post you had created in Stack Overflow and that a Teams rep responded to you. I reached out to that individual to see if any information had been collected. They advised they are still looking into it and will get back to me/us when they know more.
@stevkan, Yes I had created an issue there also as I am not sure if this a bug or a feature which is missing. Looking forward to hear from you/them soon.
hey @stevkan just wanted to check if there has been any updates on this?
Hi @harkiratsaluja
Thank you for reporting this. I see there is now a response from Meghana-MSFT on StackOverflow:
The engineering team is working on the fix for this issue. We do not have any ETA to share. –
Stack Overflow Comment
Hi @EricDahlvang this is still not working. I still get the same error.
0.2-angular-jquery.min-92954a0.js:114 2022-05-18T16:22:00.864Z [BotCardService:executeSearchInvoke()] invoke failed: bot not installed
0.2-angular-jquery.min-92954a0.js:114 {statusCode: 504, message: 'App is not installed'} undefined
Mine is having the same issue using the official example: https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/main/samples/bot-type-ahead-search-adaptive-cards/nodejs/appPackage/manifest.json
[BotCardService:executeSearchInvoke()] invoke failed: bot not installed
@EricDahlvang Hi Eric, your comment would be appreciated as we are having the same trouble.