TaskModule Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides methods for registering handlers for Teams Task Module fetch and submit events.
public class TaskModule
type TaskModule = class
Public Class TaskModule
- Inheritance
-
TaskModule
Remarks
Task Module routing uses a key/value pair embedded in the activity data to identify which handler to invoke. When Teams delivers a fetch or submit request, the SDK reads a named field from the activity data and compares its value against the registered handlers.
The default field name is "task". The value of that field (for example, "simple_form") determines which OnFetch or OnSubmit handler is called. The field name can be overridden per handler using the key parameter, but it is strongly recommended to keep the default "task" for both fetch and submit — varying only the value — to keep routing consistent and simple.
For example, if a card's submit action data contains { "task": "simple_form" }, then the handler registered with OnFetch("simple_form", ...) is called for the fetch and OnSubmit("simple_form", ...) is called when the user submits the form.
Methods
| Name | Description |
|---|---|
| OnFetch(Regex, TaskFetchHandler, String, String[], UInt16) |
Registers a handler to process the fetch of a task module. The value of the |
| OnFetch(String, TaskFetchHandler, String, String[], UInt16) |
Registers a handler to process the fetch of a task module. The value of the |
| OnSubmit(Regex, TaskSubmitHandler, String, String[], UInt16) |
Registers a handler to process the submission of a task module. The value of the |
| OnSubmit(String, TaskSubmitHandler, String, String[], UInt16) |
Registers a handler to process the submission of a task module. The value of the |