> ## 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

The **File Upload** widget enables you to create or append a WhatIf 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": ["FRTB"],
```

To configure the widget, use the following settings:

```
"accelerator_file-upload.server.params": {
    FRTB: {
      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 your files into the relevant directory in the **stage** folder. It is located in `sample-data/data/`. The files you add here are then displayed in the File Upload widget.

2. To launch the File Upload widget, from the top left 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.

<Frame>
  <img src="https://mintcdn.com/activeviam/Odsmni_6IdWKYJb8/solutions/frtb/6.0/images/add_file_upload_widget.gif?s=1325892cd1fda999d21456b9294c2c3b" alt="Adding the File Upload Widget" width="1920" height="929" data-path="solutions/frtb/6.0/images/add_file_upload_widget.gif" />
</Frame>

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).

<Frame>
  <img src="https://mintcdn.com/activeviam/3WM26kEPUrEWlXvw/solutions/frtb/6.0/images/whatif-topic-select.png?fit=max&auto=format&n=3WM26kEPUrEWlXvw&q=85&s=bbc6651f296f92d22ca0d4f8ea0761d2" alt="File Upload topic Selector" width="405" height="378" data-path="solutions/frtb/6.0/images/whatif-topic-select.png" />
</Frame>

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.

<Frame>
  <img src="https://mintcdn.com/activeviam/3WM26kEPUrEWlXvw/solutions/frtb/6.0/images/whatif-upload-select-file.png?fit=max&auto=format&n=3WM26kEPUrEWlXvw&q=85&s=f0f32872765c096798c58fb52543e770" alt="File Upload File Selector" width="576" height="305" data-path="solutions/frtb/6.0/images/whatif-upload-select-file.png" />
</Frame>

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

<Frame>
  <img src="https://mintcdn.com/activeviam/3WM26kEPUrEWlXvw/solutions/frtb/6.0/images/whatif-upload-branch-name.png?fit=max&auto=format&n=3WM26kEPUrEWlXvw&q=85&s=985ebb6d5abf4429bc72119db7b36efe" alt="File Upload Branch Name" width="523" height="215" data-path="solutions/frtb/6.0/images/whatif-upload-branch-name.png" />
</Frame>

<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. For more information on What-If Branch Permissions, see [WhatIf Changes](https://docs.activeviam.com/products/solutions/frtb/4.0/online-help/dev/dev-release/migrate-4.0.html#whatif-changes).
</Note>

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

<Note>
  In a distributed environment, the UI will report success in the case of a partial failure - where one node successfully loaded the data, but another node failed.
</Note>

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

<Frame>
  <img src="https://mintcdn.com/activeviam/3WM26kEPUrEWlXvw/solutions/frtb/6.0/images/whatif-upload-branch-created.png?fit=max&auto=format&n=3WM26kEPUrEWlXvw&q=85&s=665eef16c8420cae0911c1e451a99553" alt="File Upload Branch Name" width="1148" height="176" data-path="solutions/frtb/6.0/images/whatif-upload-branch-created.png" />
</Frame>

For more information on using the WhatIf Manager, see [WhatIf Manager](./index#whatif-manager).
