# RobotCode and external files

**URL:** <https://forum.robotframework.org/t/robotcode-and-external-files/8047>\
**Category:** Tools\
**Created:** [4 November 2024 09:17 UTC](https://forum.robotframework.org/t/robotcode-and-external-files/8047 "2024-11-04T09:17:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Syman](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@Syman](https://forum.robotframework.org/u/Syman)\
**Post date:** [4 November 2024 09:17 UTC](https://forum.robotframework.org/t/robotcode-and-external-files/8047/1 "2024-11-04T09:17:22Z")

</div>

Hi all, I am interested if RobotCode supports loading external files (\*.py) which contain test $VARIABLES?  
I only found the configuration with the \*.toml file on my quick internet research.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![falcon030](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/falcon030/32/3420_2.png) [@falcon030](https://forum.robotframework.org/u/falcon030)\
**Post date:** [4 November 2024 10:39 UTC](https://forum.robotframework.org/t/robotcode-and-external-files/8047/2 "2024-11-04T10:39:36Z")

</div>

@Syman Yes RobotCode supports this.  
Just define your variables in your .py file like this

> YOUR\_VARIABLE = “Your content of this variable”

Import the .py file in the \*\*\* Settings \*\*\* section

```
***Settings***
Variables my_variables.py

```

---

<div class="post-metadata">

**Author:** ![daniel](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/daniel/32/1492_2.png) [@daniel](https://forum.robotframework.org/u/daniel)\
**Post date:** [4 November 2024 11:03 UTC](https://forum.robotframework.org/t/robotcode-and-external-files/8047/3 "2024-11-04T11:03:53Z")

</div>

Yes sure,

you can use the `robot.toml` file like this:

```python
variable-files = ["myvariable.pys", "myothervariables.py"]

[profiles.prod]
extend-variable-files = ["myvariable2.py"]

```

or you can search in the vscode settings for `robotcode.robot.variableFiles` and add you variable files there.

---

<div class="post-metadata">

**Author:** ![Syman](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@Syman](https://forum.robotframework.org/u/Syman)\
**Post date:** [4 November 2024 11:53 UTC](https://forum.robotframework.org/t/robotcode-and-external-files/8047/4 "2024-11-04T11:53:49Z")

</div>

Thanks @daniel for your fast answer! Can you eventually send me the according documentation to that feature.

---

<div class="post-metadata">

**Author:** ![daniel](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/daniel/32/1492_2.png) [@daniel](https://forum.robotframework.org/u/daniel)\
**Post date:** [4 November 2024 12:04 UTC](https://forum.robotframework.org/t/robotcode-and-external-files/8047/5 "2024-11-04T12:04:25Z")

</div>

There is not much documentation at the moment (not enough time) but here are some links, and on the first link there is a video tutorial.

> **[RobotCode | Robot Framework for Visual Studio Code and more](https://robotcode.io/02_get_started/)**
>
> Robot Framework for Visual Studio Code and more

> **[RobotCode | Robot Framework for Visual Studio Code and more](https://robotcode.io/02_get_started/configuration)**
>
> Robot Framework for Visual Studio Code and more

> **[RobotCode | Robot Framework for Visual Studio Code and more](https://robotcode.io/03_reference/config#variable-files)**
>
> Robot Framework for Visual Studio Code and more

> **[RobotCode | Robot Framework for Visual Studio Code and more](https://robotcode.io/03_reference/config#extend-variables)**
>
> Robot Framework for Visual Studio Code and more

And for the VSCode setting, just search in vscode for the setting.

---

<div class="post-metadata">

**Author:** ![Syman](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@Syman](https://forum.robotframework.org/u/Syman)\
**Post date:** [4 November 2024 12:33 UTC](https://forum.robotframework.org/t/robotcode-and-external-files/8047/6 "2024-11-04T12:33:13Z")

</div>

I looked for this: [robot.toml configuration settings | RobotCode](https://robotcode.io/03_reference/config#variable-files)
