question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type ahead search does not work from Task Module

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
stevkancommented, Mar 10, 2022

@harkiratsaluja, I’ll be attempting a repro of this and will come back with a result and any questions.

0reactions
harkiratsalujacommented, May 18, 2022

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
Read more comments on GitHub >

github_iconTop Results From Across the Web

Type ahead search does not work from Task Module
I need to implement a scenario where type ahead search makes a call to my remote api and fills in the choice list....
Read more >
Typeahead search in Adaptive Cards - Teams - Microsoft Learn
In this module, learn what is typeahead search in adaptive cards with Input.ChoiceSet control and implement typeahead search.
Read more >
[Rendering] Typeahead provides incorrect "top" for Input ...
When an Adaptive Card's Input.ChoiceSet has Typeahead settings provided, the "count" field is expected to be set to the "top" of the invoke...
Read more >
Update a type-ahead suggestion
The knowledge base and global text searches provide suggestions as you type. These type-ahead suggestions are compiled on a nightly basis by a ......
Read more >
Real-Time Typeahead Search with Elasticsearch (AWS ...
Luckily, we don't have to build it from scratch. There are many open-source tools ready to be used, and one of them is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found