I’d say almost every meeting I’ve had in the last year has been online, through some form of virtual meeting tool. Conversations are happening everywhere and files are being shared on different platforms, and in different ways.
With the rise of remote working across the world, Microsoft Teams has become one of the most popular tools that our customers are using. Teams lets users have conversations with their colleagues, host online meetings and share and collaborate on files. Within FME, we’ve supported Slack integration for several years with the SlackConnector, but over the last year or two we’ve seen increased demand for Microsoft Teams integration with FME.
Microsoft Teams allows colleagues to chat with each other in DMs, or as a group in ‘channels’. Different channels are normally used for different conversations, so if there’s a channel relating to a specific project or customer, this is where updates will likely be communicated.
There’s also an integration with files. Colleagues can collaborate on Word, Excel, and PowerPoint, with the ability to edit and view files within Microsoft Teams. You can also upload or create new files within Teams.
These are the reasons the FME Community wanted functionality to integrate Microsoft Teams chat messages and files with their other systems and datasets.
Using FME to Support Microsoft Teams Workflows
If you’re using FME to watch a system for new data, failures, or something that needs someone’s attention, the ability to integrate with communication tools like Slack and Microsoft Teams can be invaluable. For example, at Safe we have FME Server monitoring activity in Salesforce and will notify the right people when something happens like a new support case comes in or a new comment is added to an article.
As people share files in Microsoft Teams, it makes sense that some people would want to automatically integrate these files with data in different systems. Behind the scenes, the files in Microsoft Teams are accessible through SharePoint, and FME can already upload and download data from SharePoint using the SharePointOnlineConnector. Users just need to know where in SharePoint their data lives. So, why not connect FME directly to the source?
As long as an application has an API, FME should be able to interact with it. Luckily for us, Microsoft has an API. With FME, all of the logic can be wrapped up into a custom transformer making it easier for more users to interact with Microsoft Teams.
Building The MicrosoftTeamsConnector
The first step in building a custom connector transformer, like the new MicrosoftTeamsConnector, is to understand the API that you need to use and identify which calls need to be made and what their requirements are. The Microsoft Graph API documentation has a page dedicated to Microsoft Teams. There’s also a really useful Graph Explorer, which lets you test out API calls in your web browser before starting to author your workspace in FME Desktop.
Before you can start to make API calls in FME, you’ll need to understand how a service expects users to authenticate with it. Microsoft makes it easy to find all of this information in their documentation. In FME, we use web connections, which are a convenient way of storing web service credentials to be used repeatedly.
Luckily I’ve done the hard work for you in the case of the Microsoft Teams web service, but there is still some configuration you need to do.
Once the authentication to a service is configured, you need to a way to interact with the API. Enter the HTTPCaller and JSONFragmenter, which are the two transformers that make up the majority of the MicrosoftTeamsConnector.
The HTTPCaller acts as a HTTP client, allowing you to perform actions on a resource. Most of the HTTPCallers are interacting with Microsoft Teams. There’s also some interaction with SharePoint and Drives to get information on the files and folders that exist within a channel.
The JSONFragmenters always follow a HTTPCaller because the response coming back from the Microsoft Graph API is JSON. The JSONFragmenter will split the response up into individual features based on a JSON query. It also flattens the JSON – turning JSON keys into attributes that can be used in FME.
So What Can the MicrosoftTeamsConnector Do?
The MicrosoftTeamsConnector has 3 features:
- The ability to post a message to a channel
- The ability to list all files in a channel
- The ability to get SharePoint details
For users who want FME to post a message to a channel, they just need to select this option in the transformer and type in their team name, channel name, and the message that they’d like to send.
If you just want to know what files are present in a channel, use the list files in a channel option. You’ll need to enter the team name and channel name and the transformer will return all of the top-level files and folders in that channel. It will return the name of the file (or folder), a web URL to view the file in a web browser, or download a file. You could use this to check what files are present, or just find out where their file is located.
If you want to do more with the files that exist in Microsoft Teams, such as processing them in FME, you’ll need to connect the SharePointOnlineConnector to the MicrosoftTeamsConnector. The SharePointOnlineConnector lets you list, download, delete or upload files. You could download a file in FME, use the SharePointOnlineConnector to upload the file once it’s finished processing and send a message to the channel to let people know. The MicrosoftTeamsConnector outputs all of the attributes you need to set up the SharePointOnlineConnector, saving you time.
If you’re interested in learning more about the MicrosoftTeamsConnector, it is available to download from FME Hub and you can explore it’s inner workings in FME Desktop (you can right click on any customer transformer, and click edit). For details on how to use it, check out the article on our FME Community.
If you’re inspired to create your own connector transformer, check out the FME Community to learn more about how you can do it yourself.
Feel free to leave us any feedback by commenting on the blog, transformer or articles.
Jennifer Luther ThomasJen is the FME Server Technology Expert Team Lead at Safe Software. She enjoys lifting heavy things and being active outdoors. She enjoys these things so much that she’s hoping to qualify for powerlifting nationals 2020!