> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# File Upload

> Guide to the File Upload widget in Atoti Market Risk, covering configuration settings and step-by-step instructions for uploading CSV files to create or append a What-If scenario

The **File Upload** widget enables you to create or append a What-If scenario by uploading CSV files into the cube.

## Configuring the widget

To turn on the File Upload widget, provide this code in the settings you register:

```
"accelerator_file-upload.server.whitelist": ["MRA"],
```

To configure the widget, use the following settings:

```
"accelerator_file-upload.server.params": {
    MRA: {
      groupSelectorEnabled: true,
      getFilePathsRestEndpoint:
        "/services/rest/whatif/fileUpload/retrieveStagedFile",
      sendFilePathsRestEndpoint: "/services/rest/whatif/fileUpload/upload/",
      successMessage: "What-if successfully triggered",
      initialPrompt:
        "Please select the topic you wish to contribute to your What-if",
      fileSelectorPlaceholder: "Select a File",
      uploadNamePlaceholder: "What-if Branch Name",
      stagingDirectoryName: "stage",
      filePathSpliterator: "\\",
      selectableDirectories: true,
    },
  },
```

## Using the widget

To use File Upload:

1. Add the files you want to upload into the relevant directory in the **stage** folder, located in `mr-application/src/test/resources/data/`. The files you add here are then displayed in the File Upload widget.
2. In the top menu, click **Insert** > **Widgets**. This opens the list of available widgets.
3. From the list, drag and drop the File Upload widget to your dashboard.

![Adding the File Upload Widget](https://mintcdn.com/activeviam/TlaDLheQChhUUj0_/solutions/market-risk/6.0/images/add_file_upload_widget.gif?s=bd6ee9227a4fde43d15786656d43f193)

4. Click the dropdown to select from a list of topics which are configured and have available data. For details on how to configure the topics, see [Configuring the widget](#configuring-the-widget).

![File Upload topic Selector](https://mintcdn.com/activeviam/tAG1tCcFCMIoCw-t/solutions/market-risk/6.0/images/whatif-topic-select.png?fit=max\&auto=format\&n=tAG1tCcFCMIoCw-t\&q=85\&s=003565cd68fd1306a10700d0f298c586)

5. Next, select a file. Below the topic selector you can expand a directory structure containing the files available for the upload associated with the selected topic.

![File Upload File Selector](https://mintcdn.com/activeviam/tAG1tCcFCMIoCw-t/solutions/market-risk/6.0/images/whatif-upload-select-file.png?fit=max\&auto=format\&n=tAG1tCcFCMIoCw-t\&q=85\&s=7557b81ff073ea78323c6385cb8e8a6a)

6. Once the required files are selected, enter a name for the branch in the **What-if Branch Name** field, then click **Click to Upload**.

![File Upload Branch Name](https://mintcdn.com/activeviam/tAG1tCcFCMIoCw-t/solutions/market-risk/6.0/images/whatif-upload-branch-name.png?fit=max\&auto=format\&n=tAG1tCcFCMIoCw-t\&q=85\&s=a3ed7ad86a178e30f0f0320e33197990)

> [!NOTE]
>
> You can only create or modify a branch if you have the required permissions. By default, only the creator of the branch can modify it.

This creates a branch with the given name or updates the existing branch with data from the uploaded files.

You can check and delete your branch in the What-If Manager:

![File Upload Branch Name](https://mintcdn.com/activeviam/tAG1tCcFCMIoCw-t/solutions/market-risk/6.0/images/whatif-upload-branch-created.png?fit=max\&auto=format\&n=tAG1tCcFCMIoCw-t\&q=85\&s=c96d265c30472f5c8d77919760f3d491)

For more information on using the What-If Manager, see [What-If Manager](.#what-if-manager).
