# Attaching a trace to a Process Mining activity

> With **Process Mining**, you extract the data from your business applications to get a detailed understanding of overall business processes. From **Process Mining,** you can zoom in on certain activities with **Task Mining** to gain deeper understanding of the disparate applications used to perform the activity (in addition to the system of record as observed in Process Mining) on employee machines.

## Process Mining and Task Mining

With **Process Mining**, you extract the data from your business applications to get a detailed understanding of overall business processes. From **Process Mining,** you can zoom in on certain activities with **Task Mining** to gain deeper understanding of the disparate applications used to perform the activity (in addition to the system of record as observed in Process Mining) on employee machines.

## Selecting the Process Mining activity

You can attach a **Task Mining** trace to a **Process Mining** activity directly from the trace diagram window. This allows you to easily access the **Process Mining** app and to view the ideal trace in **Process Mining** along with the activity details.

Follow these steps to attach a trace to a Process Mining activity.

1. In the trace diagram window, locate the **Appears in** section.
2. Select **Attach** next to Process Mining. The **Attach trace** dialog is displayed.
   :::note
   The **Process Mining** option is selected by default.
   :::
3. Select the Process Mining process app to which the activity belongs from the **Business process** drop-down list.
4. Select the activity to which you want to attach the task from the **Activity** drop-down list, and select **Save**.

The name of the process app and the name of the activity to which the trace is connected are displayed in the **Appears in** section, as well as the **Duration** of the activity.

   ![Attached Process Mining activity in the Appears in section](https://dev-assets.cms.uipath.com/assets/images/task-mining/task-mining-attached-process-mining-activity-in-the-appears-in-section-482721-34e9caff-4a1e78f2.webp)

## Viewing the activity in Process Mining

Follow these steps to view the activity in **Process Mining**:

1. Select the trace in the **Task Mining** project that is representative for the **Process Mining** activity.
2. Find and select the **Ideal trace** option to set this trace to be used and viewed for the activity in Process Mining.
3. Select the name of the activity in the **Appear in** section.

**Process Mining** is launched in a new browser tab, displaying the **Task Mining** trace diagram alongside the most important KPIs, which provide trace details such as application usage, number of steps, and comparisons between waiting and cycle time.

Refer to [Starting a Task Mining project from Process Mining](https://docs.uipath.com/process-mining/automation-cloud/latest/user-guide/starting-a-task-mining-project-from-process-mining) in the **Process Mining** guide for more information on **Viewing Task Mining** projects.

## Attaching a different activity

Follow these steps to select a different activity to attach to the trace:

1. Select the edit icon ![Edit icon](https://dev-assets.cms.uipath.com/assets/images/task-mining/task-mining-edit-icon-289309-cf263e21-c6525877.webp) in the **Appears in** section. The **Attach trace** dialog is displayed with the attached activity.
   :::note
   The **Process Mining** option is selected by default.
   :::
2. Select the applicable **Business process** and **Activity** from the drop-down lists and select **Save**.

The name of the process app and the name of the activity to which the trace is connected are updated in the **Appears in** section, as well as the **Duration** of the activity.

## Removing an attached activity

Follow these steps to remove the trace attached to a **Process Mining** activity:

1. Select the edit icon ![Edit icon](https://dev-assets.cms.uipath.com/assets/images/task-mining/task-mining-edit-icon-289309-cf263e21-c6525877.webp) in the **Appears in** section. The **Attach trace** dialog is displayed with the attached activity.
   :::note
   The **Process Mining** option is selected by default.
   :::
2. Select **Remove attachment**. A confirmation message is displayed.
3. Select **Confirm** to continue.

The **Attach trace** dialog is closed and the attachment is removed.
