# Get Events

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

## Overview

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

After retrieving the events, the activity returns its properties and relationships in an `Event[]` object (**Events**) that you can use as input variables in subsequent activities.

## How It Works

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

1. Complete the [Setup](https://docs.uipath.com/activities/other/latest/legacy-integrations/microsoft-teams-setup#setup) steps.
2. Add the [Microsoft Teams Scope](https://docs.uipath.com/activities/other/latest/legacy-integrations/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/activities/other/latest/legacy-integrations/microsoft-teams-get-teams#get-teams)).
4. Add the **Get Events** activity inside the **Microsoft Teams Scope** activity.
5. Enter values for the [Input](https://docs.uipath.com/activities/other/latest/legacy-integrations/microsoft-teams-get-events#input) properties.
6. Create and enter a `Channel[]` variable for your [Output](https://docs.uipath.com/activities/other/latest/legacy-integrations/microsoft-teams-get-events#output) property.
7. Run the activity.
   * Your input property values are sent to the [ListEvents](https://docs.microsoft.com/en-us/graph/api/group-list-events?view=graph-rest-beta&tabs=http) API.
   * The API returns the `Event[]` value to your output property variable.

     ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/legacy-integrations-docs-image-36316-943a3bd5-ea7b9e16.webp)

## Properties

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

### Common

#### DisplayName

The display name of the activity.

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

### Input

#### TeamId

The Id of the `Team` object that you want to retrieve events 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 (e.g., [Get Teams](https://docs.uipath.com/activities/other/latest/legacy-integrations/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.

| Attributes | Details |
| --- | --- |
| **Type** | `QueryOption[]` (OData syntax) |
| **Required** | No |
| **Default value** | Empty |
| **Allowed values** | Enter a `QueryOption[]` or `QueryOption` variable. |
| **Notes** | Enter your value using an [OData system query option](https://docs.microsoft.com/en-us/graph/query-parameters#odata-system-query-options); the format is as follows: `{New QueryOption("Option", "OptionParameter")}`.  For example, if you want to apply the `$filter` option, you would enter "filter" as the first string and then enter a [filter parameter](https://docs.microsoft.com/en-us/graph/query-parameters#filter-parameter) as the second string (e.g., `{New QueryOption("filter", "displayName eq 'General'")}`). |

### Output

#### Events

An array of events (`Event[]` object) that match **QueryOptions** value.

| Attributes | Details |
| --- | --- |
| **Type** | `Event[]` |
| **Required** | No (required if you plan to use the output data in subsequent activities) |
| **Default value** | Empty |
| **Allowed values** | Enter a `Event[]` variable. |
| **Notes** | The variable you create for this property can be used as an input variable in subsequent activities (e.g., [Delete Event](https://docs.uipath.com/activities/other/latest/legacy-integrations/microsoft-teams-delete-event#delete-event),). |
