# UiPath.Studio.Activities.Api.Activities

> In this section you can find more information on how to build activities using **UiPath.Studio.Activities.Api.Activities**.

In this section you can find more information on how to build activities using **UiPath.Studio.Activities.Api.Activities**.

## ActivityDataIds
:::note
This feature was introduced in UiPath.Studio.Activities.Api v21.4.
:::

Enables drag-and-drop functionality for activities, for example dragging items from the **Resources** panel onto an activity.

### Constants

| Type | Name |
| --- | --- |
| string | AssetDataId |
| string | ProcessDataId |
| string | QueueDataId |
| string | EntityDataId |
| string | UiElementDataId |

## IActivityFactoryRepository
:::note
This feature was introduced in UiPath.Studio.Activities.Api v21.4.
:::

A repository of activity factories.

### Methods

#### void Register(RegisterArgs registerArgs)

Registers a [RegisterArgs](https://docs.uipath.com/sdk/other/latest/developer-guide/uipathstudioactivitiesapiactivities#registerargs) specific for an activity.

| Parameter Type | Parameter Name |
| --- | --- |
| RegisterArgs | registerArgs |

#### `public void Register(Type activityType, Func<string, Activity> activityFactory, string activityDataId)`

Registers a factory method for creating the specified **activityType** type activity and associates the **activityDataId** with the activity type.

| Parameter Type | Parameter Name |
| --- | --- |
| Type | activityType |
| ``Func<string, Activity>`` | activityFactory |
| string | [ActivityDataIds](https://docs.uipath.com/sdk/other/latest/developer-guide/uipathstudioactivitiesapiactivities#activitydataids) |

#### `void Register<T>(Func<string, T> activityFactory, string activityDataId)`

Registers a factory method for creating the specified **T** type activity and associates the **activityDataId** with the activity type.

| Parameter Type | Parameter Name |
| --- | --- |
| `Func<string, T>` | activityFactory |
| string | [ActivityDataIds](https://docs.uipath.com/sdk/other/latest/developer-guide/uipathstudioactivitiesapiactivities#activitydataids) |

## IActivitySynonymService
:::note
This feature was introduced in UiPath.Studio.Activities.Api v21.10.
:::

Exposes the functionality of adding activity synonyms.

### Methods

#### void SetActivitySynonyms(Type activity, IReadOnlyCollection/ synonyms)

Adds a list of synonyms for a given activity.

| Parameter Type | Parameter Name | Remarks |
| --- | --- | --- |
| Type | Activity | The type of activity. |
| IReadOnlyCollection/ | synonyms | A collection of synonyms for the activity. |

## IActivityTriggerService
:::note
This feature was introduced in UiPath.Studio.Activities.Api v22.4.
:::

Exposes functionality for trigger activities to register information about themselves.

### Properties

| Type | Name | Description |
| --- | --- | --- |
| bool | IsEnabled | Indicates if Studio supports triggers (**HasFeature** is `true` and feature flag is `true`). |

### Methods

#### void SetData(Type activityType, TriggerData triggerData)

Allows an activity to register information about its output argument, like type (e.g. SalesForceAccount, Office365Message[]) and name.

| Parameter Type | Parameter Name | Remarks |
| --- | --- | --- |
| Type | activityType | The type of activity. |
| TriggerData | triggerData | The associated trigger data for this activity, |

## IAttendedActivityService
:::note
This feature was introduced in UiPath.Studio.Activities.Api v21.10.
:::

Exposes the functionality of setting an activity as attended.

### Methods

#### void SetActivityAttended(Type activity)

Sets the **isAttended** flag for a given activity.

| Parameter Type | Parameter Name | Remarks |
| --- | --- | --- |
| Type | Activity | The activity which needs to be registered as attended. |

## RegisterArgs
:::note
This feature was introduced in UiPath.Studio.Activities.Api v21.4.
:::

Arguments used to exchange information between Studio and activities related to activity type, activity data ID, and multiple factory methods for creating the selected activity type.

### Properties

| Type | Name | Description |
| --- | --- | --- |
| string | ActivityDataId | The associated ID for the activity type. |
| Type | ActivityType | The activity type of the activity created by the associated factory method (ActivityFactoryV1 or ActivityFactoryV3). |

### Methods

#### public `Func<string, Activity>` FactoryV1

Factory method for creating the specified activity type. The string parameter is the optional associated data (asset name, queue name, etc.).

| Parameter Type | Parameter Name | Remarks |
| --- | --- | --- |
| `Func<string, Activity>` | FactoryV1 | The type of activity. |

#### public `Func<string, Activity>` FactoryV3

Factory method for creating the specified activity type. The string parameter is the optional associated data (asset name, queue name, etc.).

| Parameter Type | Parameter Name | Remarks |
| --- | --- | --- |
| `Func<string, Activity>` | FactoryV3 | The type of activity. |

#### public `Func<string, Task<Activity>>` FactoryV4

Factory method for creating the specified activity type. The string parameter is the optional associated data (asset name, queue name, etc.). Requires Studio 2022.4 or later.

| Parameter Type | Parameter Name | Remarks |
| --- | --- | --- |
| `Func<string, Task<Activity>>` | FactoryV4 | The type of activity. |

## TriggerData
:::note
This feature was introduced in UiPath.Studio.Activities.Api v22.4.
:::

Trigger data for the activity.

### Properties

| Type | Name | Description |
| --- | --- | --- |
| string | PropertyName | Name of the activity property which holds the trigger data. |
| string | Name | Name of the variable or argument which Studio will create and map to the activity property. |
| Type | Type | The type of the trigger data (e.g. Office365Email[]). |
| ArgumentDirection | Direction | Not used, but allows activities to specify if the data is for input or output. Currently output only. |
