# Remote Layout Downloading

For situations where you want to load a dashboard layout from your robot, Elastic supports downloading a layout remotely and merging it with your current layout.

## On-Robot Configuration

In your robot code, add the following line in `robotInit()` or another initialization function

{% tabs %}
{% tab title="Java" %}

```java
WebServer.start(5800, Filesystem.getDeployDirectory().getPath());
```

{% endtab %}

{% tab title="C++" %}

```cpp
wpi::WebServer::GetInstance().Start(5800, frc::filesystem::GetDeployDirectory());
```

In addition, you will also need the following includes at the top of your file:

```cpp
#include <frc/Filesystem.h>
#include <wpinet/WebServer.h>
```

{% endtab %}

{% tab title="Python" %}

```python
import wpilib
import wpinet

wpinet.WebServer.getInstance().start(5800, wpilib.getDeployDirectory())
```

{% endtab %}
{% endtabs %}

Next, you will have to deploy the Elastic configuration file to your robot:

1. Export the layout from Elastic
2. Move the exported json file into the deploy folder of your robot project
3. Deploy your robot code

{% hint style="info" %}
The exported file must end in ".json" and should be placed in the root directory of your deploy folder, the deploy folder structure should look like this:

/deploy\
elastic-layout.json\
...
{% endhint %}

## Downloading Your Layout

To download the layout to your dashboard, enter the `File` menu, and click `Load Layout From Robot`

<figure><img src="https://2618450072-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEx5VqM8nP9DEeHJRWNYF%2Fuploads%2F9Yh90S4QiyndVjcgNBy5%2Fimage.png?alt=media&#x26;token=2dad855b-97ba-4ce3-8746-9cff7dd9e4e1" alt=""><figcaption></figcaption></figure>

Alternatively, you can use the shortcut `Ctrl + D`

A dialog will appear with 2 dropdown menus, one to select which layout to download, and another to select how you want to download the data.

<figure><img src="https://2618450072-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEx5VqM8nP9DEeHJRWNYF%2Fuploads%2FmPDWg0HW7Zdx5McR47fn%2Fimage.png?alt=media&#x26;token=b9d7a505-cc08-4aff-a6dd-6cd45e0c6d4f" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The layout file dropdown will display the name of any file in the root of your robot project deploy directory that ends with `.json`, if you aren't seeing your layout, ensure that your file is in the root of your deploy directory and the file ends with `.json`
{% endhint %}

### Download Modes

<details>

<summary>Overwrite</summary>

Keeps existing tabs that are not defined in the remote layout. However, any tabs that are defined in the remote layout will be overwritten locally.

For example, if your current layout has the tabs `Teleoperated`, `Autonomous`, and `Testing`, and your layout defines a tab named `Testing`, after downloading, any content that you have on the `Testing`tab will no longer exist and will be overwritten by whatever is on the remote layout tab.

</details>

<details>

<summary>Merge</summary>

Merge the downloaded layout with the existing one. If a new widget cannot be properly placed, it will not be added.

If your current layout has the tabs `Teleoperated`, `Autonomous`, and `Testing`, and your layout defines a tab named `Testing`, but the layout you are downloading also has a tab named `Testing`, any widgets you currently have on the `Testing` tab will remain, but new widgets will be added in spots that are not occupied.

</details>

<details>

<summary>Full Reload</summary>

Deletes the existing layout and loads the new one.

This is the same operation as opening a new layout locally, any widgets you have placed will be removed.

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://frc-elastic.gitbook.io/docs/additional-features-and-references/remote-layout-downloading.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
