# Scripts

The **Scripts** section allows you to save scripts directly within Data Mover Smart. This feature eliminates the need to retrieve scripts from a local machine, streamlining the process of configuring rules. Instead of selecting a full path for your scripts, you can simply choose from the available scripts stored in Data Mover Smart.

### Uploading a Script

To upload a new script, follow these steps:

1. Click the **New** button in the bottom right corner.
2. You will be prompted to fill out the following fields:
   * **Active:** set this option to determine if the script should be active (listed on the rules page). If you do not want the script to be active, select the toggle button to disable the option.
   * **Name:** this is a mandatory field that cannot be changed later. Assign a unique name for your script, which will be displayed when creating a rule under the **Actions** card → **Execute script** action → Script type: **Save** → **Script** drop-down menu.
   * **Description:** this field is optional. If needed, you may enter a description that provides useful information regarding the purpose of the script.
   * **Load script from file:** click the download icon to locate and upload your script from your local drive. Alternatively, you can drag and drop the script file into the designated area on the left side of the screen.
   * **Environment variables**: click the **+** button to create or override environment variables **for the selected script**:
     * **New** to create a new variable that exists only for the selected script. The **maximum length** for both the **Name** and **Value** of an environment variable is **255 characters**.
     * **Override** to select the variable you want to override and the new value you want to assign. Note that variables must be already defined in **Advanced** → **Environment variables**. Only the global variables that are still available are listed in the picker.&#x20;

{% hint style="info" %}
A script-level variable **overrides** the same name defined at the Global or OS scope. Read the [Environment variables](/data-mover-smart/settings/advanced/environment-variables.md) page for details.&#x20;
{% endhint %}

3. After uploading the script, a preview will be displayed on the right side of the screen.
4. When you are ready to confirm your upload, click the **Save** button. Upon saving, the **Details** and **History** tabs will appear on the left side of the screen.
   * **Details tab:** this tab provides the name and description of the uploaded script.
   * **History tab:** if you edit the script, this tab lists the new versions of the file. You can select which version you want to activate and apply.

### Version Management

When you upload a new version of an existing script, Data Mover Smart will automatically compare the new version with the previous one, displaying the differences on the right side of the screen. Once you save the new version, the latest version will be uploaded, and the preview will reflect this.

You can return to the **History** tab at any time to choose which version of the file should be active. The active version will be used during the execution of the rule action and in the FEL, ensuring that you always have control over the scripts being applied.


---

# 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://docs.primeur.com/data-mover-smart/settings/scripts.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.
