# Enable Actionable Insights

> The **Actionable Insights** option must be enabled in the app or Discovery Accelerator.

## Introduction

The **Actionable Insights** option must be enabled in the app or Discovery Accelerator.

:::note
If you are using the **Basic Connector** for **AppOne**, the groups and expressions described in this page are already predefined. You only need to edit the expressions to set the correct value.
:::
:::important
It is strongly recommended that you only enable **Actionable Insights** when the app or Discovery Accelerator is deployed and ready to be used. Otherwise, it can happen that you accidentally create actions by reloading all your data.
:::

First, create a new group **Actionable insights** in the `Globals` table. Also create a new group **Settings** in the **Actionable insights** group. See the illustration below.

![docs image](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-docs-image-54232-3bcfb616-be8cba78.webp)

To enable **Actionable Insights** you must create the expressions as described below in these groups.

## Step 1: Set 'Actionable Insights Integration Is Used' Expression to 'true'

By default, **Actionable Insights** is turned off in the app or Discovery Accelerator. If you want to use this feature, you must create an expression `Actionable_insights_integration_is_used` in the **Actionable insights** group in the `Globals` table and set it to `True`.

See the illustration below.

![docs image](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-docs-image-56446-e2be3dd2-3e238de1.webp)

## Step 2: Define Tenant and Folder ID

Create expressions for `Tenant` and `Folder ID` in the **Actionable insights - Settings** group in the Globals table in the app or Discovery Accelerator.

### Tenant

In the `Tenant` expression you must specify the logical name of the tenant for which actions and queue items will be defined.

If you are using an on-premise installation of **UiPath Orchestrator** the name of tenant can be found in the **General** section in *my profile*. For a cloud installation the tenant name can be found in the API Access information. See illustration below.

![docs image](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-docs-image-54264-7e2e4a2a-e00769d4.webp)

For example, if the name of the tenant is *Default*, you specify `Default` in the `Tenant` expression. See illustration below.

![docs image](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-docs-image-54392-d3800e8f-4829fe4f.webp)

:::important
The tenant must be the same as the name of the configuration file `[tenant].env` in the `orchestrator` folder in the **UiPath Process Mining** installation folder.
:::

### Folder ID

In the `Folder ID` expression you must specify the ID of the folder for which the actions and queue items are created.

The folder ID is the **fid** number of the URL when your are logged in to your **UiPath Orchestrator**. See illustration below.

![docs image](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-docs-image-54868-e4426d03-2bc13dce.webp)

For example, if the **fid** is *123456*, you specify `123456` in the `Folder ID` expression. See illustration below.

![docs image](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-docs-image-53769-d455a325-81a36393.webp)

:::note
You can set a different **folder ID** for each action and queue item that is defined in the app or Discovery Accelerator.
:::

## Step 3: Define Actions Output and Queues Output Expressions

Create `Actions output` and `Queues output` lookup expressions to concatenate all separate actions and queues. These serve as input for the Actionable insights scripts.

### Actions Output

| Step | Action |
| --- | --- |
| 1 | Create a new Lookup `Actions output` expression in the **Actionable insights** group in the  `Globals` table. |
| 2 | Set the view table that is used to define actions as the **Input table**.  See [Define Actions and Queues](https://docs.uipath.com/process-mining/standalone/2021.10/user-guide/using-actions-and-queues#define-actions-and-queues). |
| 3 | Enter the following expression:  `jointext(records.Actions, NL)` |

See the illustration below for an example.

![docs image](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-docs-image-54012-22b19f2d-fd194c5e.webp)

### Queues Output

| Step | Action |
| --- | --- |
| 1 | Create a new Lookup `Queues output` expression in the **Actionable insights** group in the `Globals` table. |
| 2 | Set the view table that is used to define actions as the **Input table**.  See [Defining Actions and Queues](https://docs.uipath.com/process-mining/standalone/2021.10/user-guide/using-actions-and-queues#define-actions-and-queues). |
| 3 | Enter the following expression:  `jointext(records.Queues, NL)` |

See the illustration below for an example.

![docs image](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-docs-image-54616-46da0952-7580508d.webp)

## Step 4: Create tables for Actions and Queues

Follow these steps to create connection string tables for `Actions` and `Queues`.

| Step | Action |
| --- | --- |
| 1 | Create a new table group and rename it to **Actionable insights**. |
| 2 | Create a new connection string table `Actions`.  Enter the following **Connection string**:  ``` 'driver={mvscript; script=generic; mv-enable=' + Actionable_insights_integration_is_used + ';' ```  Enter the following **Query**:  ``` '&scriptFile=' + urlencode("Actionable insights/addActionItems.py")                + '&inputData=' + urlencode(Actions_output)                + '&args=' + listtojson(['<SCRIPT>', '<INPUT>', if(Tenant <> null, Tenant, '')]) ```  **Note:** Make sure that the **Table scope** is set to *Workspace*. |
| 3 | Create a new connection string table `Queues`.  Enter the following **Connection string**:  ``` 'driver={mvscript; script=generic; mv-enable=' +  Actionable_insights_integration_is_used + ';' ```  Enter the following **Query**: ``` '&scriptFile=' + urlencode("Actionable insights/addQueueItems.py")                +'&inputData=' + urlencode(Queues_output)                + '&args=' + listtojson(['<SCRIPT>','<INPUT>', if(Tenant <> null, Tenant, '')]) ```  **Note:** Make sure that the **Table scope** is set to *Workspace*. |

See the illustration below.

![docs image](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-docs-image-53796-1e7f58a3-bf118428.webp)
