# Set variables

### Description

The `Set variables` action sets variables at various scopes.

### Options

| Option                  | Description                                                                                                                                                       |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Properties file         |                                                                                                                                                                   |
| Workflow action name    | The name of the workflow action.                                                                                                                                  |
| Name of properties file | The name of the properties file.                                                                                                                                  |
| Variable scope          | <ul><li>Valid in the Java Virtual machine</li><li>Valid in the current workflow</li><li>Valid in the parent workflow</li><li>Valid in the root workflow</li></ul> |
| Settings                |                                                                                                                                                                   |
| Variable substitution   | Whether or not to substitute variables. Leave unchecked only if you actually want to set a literal value like `${MyVariable}` in the Value column.                |
| Variables               | A list of variables to set to a certain value at a certain scope.                                                                                                 |

### Working with Properties Files

Properties files are simple text files used to store key-value pairs. They are commonly used to manage configuration settings and variables outside of the codebase. In Apache Hop, a properties file can be used to set multiple variables at once in a workflow.

A properties file is a text file with the `.properties` extension. Each line in the file represents a key-value pair. The key and value can be separated by an equals sign (`=`), a colon (`:`), or whitespace characters.

### Variable substitution

The "Variable substitution" option allows you to dynamically create and set variables based on existing variable values. When enabled, any variable references in the variable name or value fields will be resolved before the variables are set. This enables the creation of new variables whose names and values depend on other variable contents, providing a flexible and dynamic approach to variable management within workflows. The syntax `${MyVariable}` is used to retrieve variable values.


---

# 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-shaper-1.21/knowing-the-data-shaper-designer/workflows/actions/setvariables.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.
