简体   繁体   中英

Messaging Extension for Microsoft Teams doesn't display multiple parameter list for search

I'm trying to use a Teams messaging extension to conduct a search using more than one field. As per the MS Teams docs , it should be possible to specify multiple parameters for a messaging extension of type "query".

For search based messaging extension set the type parameter to query. Below is an example of a manifest with a single search command. A single messaging extension can have up to 10 different commands associated with it. This can include both multiple search and multiple Action-based commands.

However, from what I can see multiple parameters only work for action types, not queries. I only see a single textbox for search whereas my manifest specifies multiple fields.

在此处输入图像描述

The following is an excerpt from the manifest.

"composeExtensions": [
        {
            "botId": "[omitted]",
            "canUpdateConfiguration": true,
            "commands": [
                {
                    "id": "search",
                    "type": "query",
                    "title": "search",
                    "description": "search",
                    "initialRun": false,
                    "fetchTask": false,
                    "context": [
                        "commandBox",
                        "compose",
                        "message"
                    ],
                    "parameters": [
                        {
                            "name": "hello",
                            "title": "hello",
                            "description": "hello",
                            "inputType": "text"
                        },
                        {
                            "name": "test",
                            "title": "test",
                            "description": "test",
                            "inputType": "text"
                        }
                    ]
                },
                {
                    "id": "addTodo",
                    "type": "action",
                    "title": "Create To Do",
                    "description": "Create a To Do item",
                    "initialRun": false,
                    "fetchTask": false,
                    "context": [
                        "commandBox",
                        "message",
                        "compose"
                    ],
                    "parameters": [
                        {
                            "name": "Name",
                            "title": "Title",
                            "description": "To Do Title",
                            "inputType": "text"
                        },
                        {
                            "name": "Description",
                            "title": "Description",
                            "description": "Description of the task",
                            "inputType": "textarea"
                        },
                        {
                            "name": "Date",
                            "title": "Date",
                            "description": "Due date for the task",
                            "inputType": "date"
                        }
                    ]
                }
            ]
        }
    ],

I'd appreciate any help in figuring out if this is at all possible. If not, are there any alternatives? My use case involves a user conduct a private search (ie the individual with whom they're chatting are unable to view the search result/query) and select an appropriate result from the list and send to another individual via chat.

Thanks in advance.

You'd need to specify multiple search commands, not multiple parameters (with one parameter per search command). Also note that you can't actually trigger a search-based command from an message, so you should only include the compose and commandBox scopes for them.

You can see what this will look like in the GitHub app for Teams:

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM