- Release Notes
- Overview
- Getting Started
- Marketplace Vendors
- Marketplace Customers
- Publishing Guidelines
- Publishing Guidelines for Ready-to-go Automations
- Publishing Guidelines for Solution Accelerators
- Publishing Guidelines for Integration Service Connectors
- Security & IP Protection
- Other UiPath Listings
- Node-RED
- Setup
- Quickstart - Get Teams, Channels, and Messages
- Quickstart - Get Chats and Send Message
- Teams
- Microsoft Teams Scope
- Create Team
- Create Team From Group
- Get Team
- Get Teams
- Channels
- Create Channel
- Delete Channel
- Get Channel
- Get Channels
- Update Channel
- Chats
- Get Chat
- Get Chats
- Get Chat Members
- Messages
- Get Message
- Get Messages
- Get Message Replies
- Reply To Message
- Send Message
- Events
- Create Event
- Delete Event
- Get Event
- Get Events
- Users
- Get User Presence
- How It Works
- Technical References
- Get Started
- About
- Setup
- Technical References
- Azure Form Recognizer Scope
- Activities
- Analyze Form
- Analyze Form Async
- Get Analyze Form Result
- Analyze Receipt
- Analyze Receipt Async
- Get Analyze Receipt Result
- Analyze Layout
- Analyze Layout Async
- Get Analyze Layout Result
- Train Model
- Get Models
- Get Model Keys
- Get Model Info
- Delete Model
- Connectors
- How to Create Activities
- Build Your Integration
Quickstart - Get Teams, Channels, and Messages
The purpose of this guide is to help you create a working sample that uses different Microsoft Teams activities, including the Get Teams, Get Channels, Get Messages, and activities.
This working sample enables you to quickly verify the connection to your registered Microsoft Teams application and get familiar with the activity's input/output datatypes.
After completing the steps in this guide, you'll have an automation sequence that does the following:
- Establishes a connection to your registered Microsoft Teams application (Microsoft Teams Scope).
- Finds and returns a team that matches your team search query (Get Teams).
- Finds and returns channel, from your specified team, that matches your channel search query (Get Channels).
- Retrieves all messages from your specified channel (Get Messages).
-
Verifies the messages were retrieved by outputting the message body content and returning any message replies (For Each and Write Line, and Get Message Replies).
Before you begin:
- Complete the Microsoft Teams Setup steps.
-
Create or use an existing Team and Channel, send at least one message and reply to that message.
-
To use the same values as we do in this guide, create and send the following:
- Team name: Quickstart_Test1
- Channel: QS4_Channel
- Message 1: Hello from UiPath!
- Reply 1: Hey, hey, hey
- Reply 2: So happy to be here!
- Message 2: What time is the meeting?
- Reply 1: 11am
-
- Add the Microsoft Teams Scope activity to your project.
-
Enter the ApplicationId for your registered application.
- For more information, see the Register your application section in Setup guide.
-
From the AuthenticationType drop-down list, select the applicable authentication flow (e.g., InteractiveToken).
- For more information, see the Unattended vs. Attended Automation in the Microsoft Teams Scope activity page.
- Add the Get Teams activity after the Microsoft Teams Scope activity.
- Select the type of teams that you want to retrieve from the ListType drop-down list (e.g. MyJoinedTeams)
-
Enter your QueryOptions to find a specific team from your list of teams (e.g., {New QueryOption("filter", "displayName eq 'Team Name'")}).
- For more information, see the QueryOptions section in the Get Teams activity page.
-
Create and enter a
Team[]
variable for your Teams value (e.g., myTeams).- When creating your variable, select Microsoft.Graph.Team as the variable type.
- Add the Get Channels activity after the Get Teams activity.
-
Enter your QueryOptions to find a specific channel from your specified team (e.g., {New QueryOption("filter", "displayName eq 'Channel Name'")}).
- For more information, see the QueryOptions section in the Get Channels activity page.
- In the TeamId property, enter the
Team[]
variable you created for the Get Teams activity. To enter aString
value, specify the item in the array and append .Id to the end of the variable (e.g., myTeams(0).Id). -
Create and enter a
Channel[]
variable for your Channels value (e.g., myChannels).- When creating your variable, select Microsoft.Graph.Channel as the variable type.
- Add the Get Messages activity after the Get Channels activity.
- In the ChannelId property, enter the
Channel[]
variable you created for the Get Channels activity. To enter aString
value, specify the item in the array and append .Id to the end of the variable (e.g., myChannels(0).Id). - In the TeamId property, enter the
Team[]
variable you created for the Get Teams activity. To enter aString
value, specify the item in the array and append .Id to the end of the variable (e.g., myTeams(0).Id). - To limit the number of messages that you'll output, enter a low number in the Limit property (e.g., 5).
-
Create and enter a
ChatMessage[]
variable for your Messages value (e.g., myMessages).-
When creating your variable, select Microsoft.Graph.ChatMessage as the variable type.
-
-
To test that your activities retrieved the Team, Channel and Messages, add a For Each activity after the Get Messages activity.
- In the TypeArgument property, select Microsoft.Graph.ChatMessage.
- In the Values property, enter the
ChatMessage[]
variable you created for the Get Messages activity (e.g., myMessages).
-
In the For Each activity, add a Write Line activity.
- In the Text property, enter "Message: "+ item.Body.Content
-
Add the Get Message Replies activity after the Write Line activity.
- In the ChannelId property, enter the
Channel[]
variable you created for the Get Channels activity. To enter aString
value, specify the item in the array and append .Id to the end of the variable (e.g., myChannels(0).Id).
- In the ChannelId property, enter the
- To limit the number of messages that you'll output, enter a low number in the Limit property (e.g., 2).
- In the MessageId property, enter Item.Id to get each of the retrieved messages' replies.
- In the TeamId property, enter the
Team[]
variable you created for the Get Teams activity. To enter aString
value, specify the item in the array and append .Id to the end of the variable (e.g., myTeams(0).Id). -
Create and enter a
ChatMessage[]
variable for your MessageReplies value (e.g., myReplies).- When creating your variable, select _Microsoft.Graph.ChatMessage_as the variable type.
-
Add another For Each activity after the Get Message Replies activity.
- In the TypeArgument property, select Microsoft.Graph.ChatMessage.
- In the Values property, enter the
ChatMessage[]
variable you created for the Get Message Replies activity (e.g., myReplies).
-
In the For Each activity, add a Write Line activity.
- In the Text property, enter "Reply: "+ item.Body.Content
-
Click Run and verify the Output window includes your messages and their associated replies.
You're done!
When you're ready, try the other Quickstart guides to get more familiar with the different Microsoft Teams activities.
To learn more about the Microsoft Teams activities (including example property inputs/outputs), see the following activity pages for a complete activity list and links to the activity detail pages.