# Get channels

> Using your search parameters (**QueryOptions**) and specified team (**TeamId**), the **Get Channels** activity calls the Microsoft Graph [ListChannels](https://docs.microsoft.com/en-us/graph/api/channel-list?view=graph-rest-beta&tabs=http) API to retrieve the channels that match your query.

## Overview

Using your search parameters (**QueryOptions**) and specified team (**TeamId**), the **Get Channels** activity calls the Microsoft Graph [ListChannels](https://docs.microsoft.com/en-us/graph/api/channel-list?view=graph-rest-beta&tabs=http) API to retrieve the channels that match your query.

After retrieving the channels, the activity returns its properties and relationships in a `Channel[]` object (**Channels**) that you can use as input variables in subsequent activities (for example, `Channel(0).Id` in [Get Messages](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-teams-get-messages#get-messages), [Send Message](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-teams-send-message#send-message), and so on).

## How it works

The following steps and message sequence diagram is an example of how the activity works from design time (that is, the activity dependencies and input/output properties) to run time.

1. Complete the [Setup](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-teams-setup#setup) steps.
2. Add the [Microsoft Teams Scope](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-teams-scope#microsoft-teams-scope) activity to your project.
3. Add an activity or run an external process that outputs a `Team.Id` value (e.g., [Get Teams](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-teams-get-teams#get-teams)).
4. Add the **Get Channels** activity inside the **Microsoft Teams Scope** activity.
5. Enter values for the [Input](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-teams-get-channels#input) properties.
6. Create and enter a `Channel[]` variable for your [Output](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-teams-get-channels#output) property.
7. Run the activity.
   * Your input property values are sent to the [ListChannels](https://docs.microsoft.com/en-us/graph/api/channel-list?view=graph-rest-beta&tabs=http) API.
   * The API returns the `Channel[]` value to your output property variable.

     ![docs image](https://dev-assets.cms.uipath.com/assets/images/marketplace/marketplace-docs-image-36668-f3571fc2-ca2b4ee0.webp)

## Properties

The values for the following properties are specified when adding this activity to your project in UiPath Studio.

![docs image](https://dev-assets.cms.uipath.com/assets/images/marketplace/marketplace-docs-image-35120-a70ade9f-e6686ad9.webp)

### Common

#### DisplayName

The display name of the activity.

| Attributes | Details |
| --- | --- |
| **Type** | `String` |
| **Required** | Yes |
| **Default value** | *Get Channels* |
| **Allowed values** | Enter a `String` or `String` variable. |
| **Notes** | N/A |

### Input

#### TeamId

The Id of the `Team` object that you want to retrieve channels from.

| Attributes | Details |
| --- | --- |
| **Type** | `String` |
| **Required** | Yes |
| **Default value** | Empty |
| **Allowed values** | Enter a `String` or `String` variable. |
| **Notes** | To get the `Team.Id` value, use an external process or activity that includes the `Team.Id` value in its output (for example, [Get Teams](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-teams-get-teams#get-teams) or external API call) |

### Misc

#### Private

If selected, the values of variables and arguments are no longer logged at Verbose level.

| Attributes | Details |
| --- | --- |
| **Type** | Checkbox |
| **Required** | No |
| **Default value** | Not Selected |
| **Allowed values** | Selected or Not Selected |
| **Notes** | N/A |

### Options

#### QueryOptions

The search parameters that you want to apply when retrieving your list of channels.

 <colgroup>
  <col/>
  <col/>
 </colgroup>
 
  
     Attributes  
     Details  
  
 
 
  
    Type 
    <code>QueryOption[]</code> (OData syntax) 
  
  
    Required 
     No  
  
  
    Default value 
     Empty  
  
  
    Allowed values 
    Enter a <code>QueryOption[]</code> or <code>QueryOption</code> variable. 
  
  
    Notes 
   
      
         Enter your value using an  OData system query option  ; the format is as follows: <code>_&#123;New QueryOption("Option", "OptionParameter")}</code> . 
         For example, if you want to apply the <code>$filter</code> option, you would enter "filter" as the first string and then enter a  filter parameter  as the second string (e.g., <code>&#123;New QueryOption("filter", "displayName ne 'General'")}</code> . 
      

  
 

### Output

#### Channels

An array of channels (`Channel[]` object) that match **QueryOptions** value.

 <colgroup>
  <col/>
  <col/>
 </colgroup>
 
  
     Attributes  
     Details  
  
 
 
  
    Type 
    <code>Channel[]</code> 
  
  
    Required 
     No (required if you plan to use the output data in subsequent activities)  
  
  
    Default value 
     Empty  
  
  
    Allowed values 
    Enter a <code>Channel[]</code> variable. 
  
  
    Notes 
   
      
          The variable you create for this property can be used as an input variable in subsequent activities (e.g.,  Get Messages  ,  Send Message  , etc.).  * When using this variable as an input property value, specify the item in the array that you want to use (e.g., createdChannels(0) ).  
         The <code>Channel</code> object includes multiple  properties  and  relationships  that you can use in other activities.The example image below shows some of the properties that you can return. 
         Note - some properties listed in the designer are not applicable to the <code>Channel</code> object (e.g., <code>Visibility</code> ). For a list of the applicable <code>Team</code> properties, visit the links above. 
      

  
 

## Example

The following image shows an example of the activity dependency relationship and input/output property values.

For step-by-step instructions and examples, see the [Quickstart](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-teams-quickstarts) guides.

![docs image](https://dev-assets.cms.uipath.com/assets/images/marketplace/marketplace-docs-image-36296-dfcbdf20-06198f32.webp)
