Collect Input in Microsoft Teams with Task Modules

Microsoft 365 Developer · Beginner ·📰 AI News & Updates ·5y ago

Key Takeaways

This video demonstrates the basics of task modules in Microsoft Teams, including how to create and customize a tab to launch a task module, and how to collect input from users using task modules.

Full Transcript

welcome to the module on collecting input in microsoft teams using task modules hi i'm andrew connell i'm a microsoft mvp in the area of microsoft 365 development i have a lot of experience with sharepoint development microsoft graph microsoft teams developing add-ins for microsoft office as well as developing applications for microsoft identity including azure active directory this video is the first in a series of videos on this microsoft learning module this video is also part of a playlist that includes all the videos that are associated with this module so you can watch them in order the playlist and all its included videos are associated with a microsoft learning module that includes hands-on lab exercises and additional resources check the notes for this video and the associated playlist for more information and where to find the microsoft learning module okay let's get started task modules are modals that you can populate with either an adaptive card or an embedded web or content page for use in your custom microsoft teams app user experience for workflows that require data input task modules allow you to gather information in a teams aware pop-up in this first section we're going to learn the basics of a task module in microsoft teams and how to collect input from users in a custom teams tab we're going to specifically cover an overview of task modules how to invoke task modules and how to dismiss text task modules we'll first start with an overview on task modules task modules allow you to create modal pop-up experiences in your team's applications inside the pop-up you can run your own custom html or javascript code show an iframe based widget such as a youtube or a microsoft stream video or display an adaptive card and they're especially useful for starting and completing tasks or displaying rich information like videos or a power bi dashboard a pop-up experience is often more natural for users starting and completing tasks compared to a tab or a conversational based bot experience task modules build on the foundation of microsoft teams tabs they're essentially a tab inside of a pop-up window they use the same sdk so if you've built a tab you're already 90 of the way to creating a task module now let's look at the structure of a task module or at least what the user experience looks like you can see it has an app icon a short name and then the title of the task module all in the header as well as the close or cancel button as well in that five uh the blue box where we see a five number um that is the entire area that's available to the web page uh if you're using the web page option for rendering your task module everything there you have full control over the ux however if you're using an adaptive card you see how we have in step six or in the section six with the red box around it that's where your adaptive card is going to be rendered and so you see you have a little bit of buffer that's added in the margins for the left and the sides in the top and then finally you also have the adaptive card button that will get added in step seven so you can see the two experiences you've got one gives you full control over the ux in the blue box if you use a web page option whereas an adaptive card is going to be a little bit more constrained but also a more unified look that you have less that you have to worry about now let's talk a little bit about invoking task modules now let's talk a little bit about invoking task modules task modules can be invoked from tabs bots or deep links and the ema code invocation for each one is a little bit different when you invoke it from a tab use the microsoft teams javascript sdk to call the start task method method we'll see that a little bit you can also invoke it from a deep link so what you'll do is you'll create a special url with the details of the task module in the query string and that will tell microsoft teams to launch the task module and then finally you can also invoke it from a bot and you do that by having your bot submit a special invoke message back to microsoft teams let's talk about developing custom microsoft teams task modules task modules can be implemented as a web page and it's very similar to working with custom tabs you're going to display your task module within an iframe so the task module is going to open up just like a tab would open and it's going to have an iframe in it to display the web page users can also close the task module with a traditional x close button in the upper right corner of the iframe but you can also programmatically close the task module as well or submit it using the javascript sdk by calling the submit task method from inside of your webpage to invoke your task module from a tab you're going to call the microsoftteams.tasks.starttask method on the javascript sdk and for that you can pass in two values you can pass in a task info object which is required and a callback the task info object which is actually an object of type task module task info contains a bunch of different properties the title property appears below the app name and to the right of the app icon while the height and width are the number of pixels of the size of the task module or you can use a named size so for example we have small medium and large so what it means for the width is that it's either 20 50 or 60 percent of the width while the height values are 20 50 and 66 percent the url of the page that you specify is what's loaded in the iframe in the task module now this is not used when we work with adaptive cards and the fallback url well if a client doesn't support the task module feature this url is going to be opened up in a browser tab now there are a couple other properties that are used when working with task modules and tabs so like additional properties apply in other scenarios such as like when we use an adaptive card or when we invoke it from a bot i'm going to look at these two scenarios later in this module now the second parameter of the start task method is the callback and the callback can receive a couple different parameters now the callback parameters it can receive is an error object or a string a result string or the result can be really anything microsoft teams will execute the callback if there's an error or when the task module triggers it from within the task module you can submit the data that was collected from the user by calling the submit task method the result object that you pass into that can be either a string or an object and this method will call the registered callback handler in the start task method that you call that you set up if the user closes the task module or an error occurs microsoft teams will close the test module and invoke the provided callback with an error object if there was a problem invoking the task module it's going to be returned to you in one of these following errors that your common errors that you may see there's one error called the values for both card and url were not specified they were specified but we can't have both of them we have to have just one the task info contains values for both the url and the card property these are mutually exclusive you should only use one of these because you're either using a url or a card the second error is you must specify a value for either card or url again they're mutually exclusive but you got to have at least one the invalid app id um what that is is that saying the task info.app id property that's not valid the one that you specify when you said submit task or start task and the user canceled or closed the task module that's notifying the your tab or whatever opened up the task module that the user cancelled out of it

Original Description

In this module, you’ll learn the basics of task modules in Microsoft Teams and how to create and to customize a tab that will be used to launch a task module. This video is part of a series in a playlist and is associated with a Microsoft Learning module: 'Collect Input in Microsoft Teams with Task Modules'. Refer to the following URL to access the Microsoft Learning module for hands-on lab exercises and more resources: https://docs.microsoft.com/learn/modules/msteams-task-modules
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Microsoft 365 Developer · Microsoft 365 Developer · 0 of 60

← Previous Next →
1 Adaptive Cards community call-February 2019
Adaptive Cards community call-February 2019
Microsoft 365 Developer
2 PowerApps community call-February 2019
PowerApps community call-February 2019
Microsoft 365 Developer
3 Microsoft Graph community call-March 2019
Microsoft Graph community call-March 2019
Microsoft 365 Developer
4 Office Add ins community call-March 2019
Office Add ins community call-March 2019
Microsoft 365 Developer
5 PowerApps community call-March 2019
PowerApps community call-March 2019
Microsoft 365 Developer
6 Microsoft Teams community call-March 2019
Microsoft Teams community call-March 2019
Microsoft 365 Developer
7 Using React and Office UI Fabric React Components
Using React and Office UI Fabric React Components
Microsoft 365 Developer
8 Build Microsoft Teams customization using SharePoint Framework
Build Microsoft Teams customization using SharePoint Framework
Microsoft 365 Developer
9 Microsoft Graph community call-April 2019
Microsoft Graph community call-April 2019
Microsoft 365 Developer
10 Using Change Notifications and Track Changes with Microsoft Graph
Using Change Notifications and Track Changes with Microsoft Graph
Microsoft 365 Developer
11 Office Add Ins community call-April 2019
Office Add Ins community call-April 2019
Microsoft 365 Developer
12 Adaptive Cards community call-April 2019
Adaptive Cards community call-April 2019
Microsoft 365 Developer
13 Microsoft Teams community call-April 2019
Microsoft Teams community call-April 2019
Microsoft 365 Developer
14 Getting Started with Microsoft Graph and Application Registration
Getting Started with Microsoft Graph and Application Registration
Microsoft 365 Developer
15 Getting Started with Microsoft Graph and the Directory API
Getting Started with Microsoft Graph and the Directory API
Microsoft 365 Developer
16 Getting Started with Microsoft Graph and Microsoft Teams
Getting Started with Microsoft Graph and Microsoft Teams
Microsoft 365 Developer
17 Getting Started with Microsoft Graph Explorer
Getting Started with Microsoft Graph Explorer
Microsoft 365 Developer
18 Getting Started with Microsoft Graph
Getting Started with Microsoft Graph
Microsoft 365 Developer
19 Getting Started with Microsoft Graph and Mail API
Getting Started with Microsoft Graph and Mail API
Microsoft 365 Developer
20 Getting Started with Microsoft Graph and Office 365 Groups
Getting Started with Microsoft Graph and Office 365 Groups
Microsoft 365 Developer
21 Getting Started with Microsoft Graph and the Calendar API
Getting Started with Microsoft Graph and the Calendar API
Microsoft 365 Developer
22 Getting Started with the Microsoft Graph Toolkit
Getting Started with the Microsoft Graph Toolkit
Microsoft 365 Developer
23 Getting Started with Microsoft Graph and JavaScript SDKs
Getting Started with Microsoft Graph and JavaScript SDKs
Microsoft 365 Developer
24 Getting Started with Microsoft Graph and .NET SDKs
Getting Started with Microsoft Graph and .NET SDKs
Microsoft 365 Developer
25 Discover how businesses can be more productive with Microsoft 365 integrations
Discover how businesses can be more productive with Microsoft 365 integrations
Microsoft 365 Developer
26 Adaptive Cards community call-May 2019
Adaptive Cards community call-May 2019
Microsoft 365 Developer
27 Office Add-ins community call-May 2019
Office Add-ins community call-May 2019
Microsoft 365 Developer
28 Why We Built on Microsoft Teams
Why We Built on Microsoft Teams
Microsoft 365 Developer
29 Microsoft Teams community call-May 2019
Microsoft Teams community call-May 2019
Microsoft 365 Developer
30 Microsoft Graph community call-June 2019
Microsoft Graph community call-June 2019
Microsoft 365 Developer
31 Build Angular SPA's with Microsoft Graph - June 2019
Build Angular SPA's with Microsoft Graph - June 2019
Microsoft 365 Developer
32 Office Add -ins community call-June 2019
Office Add -ins community call-June 2019
Microsoft 365 Developer
33 Build Android native apps with the Microsoft Graph Android SDK - June 2019
Build Android native apps with the Microsoft Graph Android SDK - June 2019
Microsoft 365 Developer
34 Build MVC apps with Microsoft Graph - June 2019
Build MVC apps with Microsoft Graph - June 2019
Microsoft 365 Developer
35 Authenticate and connect with Microsoft Graph - June 2019
Authenticate and connect with Microsoft Graph - June 2019
Microsoft 365 Developer
36 Microsoft Graph data connect - June 2019
Microsoft Graph data connect - June 2019
Microsoft 365 Developer
37 Change notifications with Microsoft Graph - June 2019
Change notifications with Microsoft Graph - June 2019
Microsoft 365 Developer
38 Build iOS native apps with the Microsoft Graph REST API - June 2019
Build iOS native apps with the Microsoft Graph REST API - June 2019
Microsoft 365 Developer
39 Build Node.js Express apps with Microsoft Graph - June 2019
Build Node.js Express apps with Microsoft Graph - June 2019
Microsoft 365 Developer
40 Smart UI with Microsoft Graph - June 2019
Smart UI with Microsoft Graph - June 2019
Microsoft 365 Developer
41 Leveraging the Microsoft Graph API from the SharePoint Framework - June 2019
Leveraging the Microsoft Graph API from the SharePoint Framework - June 2019
Microsoft 365 Developer
42 Build UWP apps with Microsoft Graph - June 2019
Build UWP apps with Microsoft Graph - June 2019
Microsoft 365 Developer
43 Build React SPA's with Microsoft Graph - June 2019
Build React SPA's with Microsoft Graph - June 2019
Microsoft 365 Developer
44 Getting Started with Microsoft Graph and Batching
Getting Started with Microsoft Graph and Batching
Microsoft 365 Developer
45 Getting Started with Microsoft Graph and Change Notifications
Getting Started with Microsoft Graph and Change Notifications
Microsoft 365 Developer
46 Getting Started with Microsoft Graph and Consent Permissions
Getting Started with Microsoft Graph and Consent Permissions
Microsoft 365 Developer
47 Getting Started with Microsoft Graph and Education
Getting Started with Microsoft Graph and Education
Microsoft 365 Developer
48 Getting Started with Microsoft Graph and Financials
Getting Started with Microsoft Graph and Financials
Microsoft 365 Developer
49 Getting Started with Microsoft Graph and Excel
Getting Started with Microsoft Graph and Excel
Microsoft 365 Developer
50 Getting Started with Microsoft Graph and Data Connect
Getting Started with Microsoft Graph and Data Connect
Microsoft 365 Developer
51 Getting Started with Microsoft Graph and Intune
Getting Started with Microsoft Graph and Intune
Microsoft 365 Developer
52 Getting Started with Microsoft Graph and Notifications
Getting Started with Microsoft Graph and Notifications
Microsoft 365 Developer
53 Getting Started with Microsoft Graph and OneNote
Getting Started with Microsoft Graph and OneNote
Microsoft 365 Developer
54 Getting Started with Microsoft Graph and OneDrive
Getting Started with Microsoft Graph and OneDrive
Microsoft 365 Developer
55 Getting Started with Microsoft Graph and Open Extensions
Getting Started with Microsoft Graph and Open Extensions
Microsoft 365 Developer
56 Getting Started with Microsoft Graph and Paging
Getting Started with Microsoft Graph and Paging
Microsoft 365 Developer
57 Getting Started with Microsoft Graph and Schema Extensions
Getting Started with Microsoft Graph and Schema Extensions
Microsoft 365 Developer
58 Getting Started with Microsoft Graph and Security API
Getting Started with Microsoft Graph and Security API
Microsoft 365 Developer
59 Getting Started with Microsoft Graph and Query Parameters
Getting Started with Microsoft Graph and Query Parameters
Microsoft 365 Developer
60 Getting Started with Microsoft Graph and Reporting API
Getting Started with Microsoft Graph and Reporting API
Microsoft 365 Developer

This video teaches the basics of task modules in Microsoft Teams, including how to create and customize a tab to launch a task module, and how to collect input from users using task modules. It covers the structure of a task module, how to invoke task modules, and how to develop custom task modules.

Key Takeaways
  1. Create a custom tab in Microsoft Teams
  2. Invoke a task module from a tab using the Microsoft Teams JavaScript SDK
  3. Implement a task module as a web page
  4. Use adaptive cards to display rich information
  5. Collect input from users using task modules
💡 Task modules allow you to create modal pop-up experiences in your Microsoft Teams applications, which can be used to gather information from users or display rich information.

Related Reads

📰
Ask HN: Add flag for AI-generated articles
Learn how to identify and flag AI-generated articles on platforms like Hacker News and why it matters for maintaining content quality
Hacker News (AI)
📰
Apple’s Cloud AI Bet Has a Hidden Sales Lesson
Learn how Apple's cloud AI strategy holds a hidden sales lesson for businesses, focusing on privacy, security, and trust-building with customers.
Medium · Startup
📰
The Field of Continuous Intelligence
Learn how Continuous Intelligence is changing the field of AI by becoming a mindset rather than a task
Medium · AI
📰
Memory Capacity Production Slowly Expanding To Meet AI Industry Demand
Memory capacity production is expanding to meet AI industry demand with new facilities from major manufacturers like Samsung and Micron
Forbes Innovation
Up next
Has Farage upset Reform supporters? | FT #shorts
Financial Times
Watch →