The route

Variables in paths

Download the exercise files

A pipeline that runs every day shouldn't overwrite yesterday's file, and one that moves from your laptop to a server shouldn't have your laptop's folder baked into it. Both problems have the same fix: variables in the output path. This level uses a built-in one for the date and one of your own for the folder.

Goal

A pipeline that writes the paid orders to <your export folder>/paid_orders_<today>.csv, where the folder comes from a variable you create and the date from a built-in one.

You'll need

  • Level 3.2's orders.csv.
  • About 15 minutes.

Steps

1. See the built-in variables

In the left panel, open Resources and expand RUNTIME ▸ Built-in Variables:

The built-in date and time variables

Variable Becomes
@DATE 2026-09-24
@DATETIME 2026-09-24T143015
@YEAR, @MONTH, @DAY 2026, 09, 24
@TIME 143015

They're filled in when the run starts, in UTC — around midnight, "today" may be your yesterday or tomorrow.

2. Create your own

Still under RUNTIME, hover Variables and click +. Create:

Field Value
Variable Name export_folder
Type String
Description Where daily exports are written
Value a folder Odara can write to

New Context Variable

This is a context variable: it belongs to the project, so every pipeline in it can use it, and changing the value in one place changes it for all of them.

3. Use both in a path

Create a pipeline w3-6-variables: a CSV Source orders, a SQL node paid_orders with SELECT * FROM input WHERE status = 'paid', and a CSV Write daily_export. Set the target's path fields to:

Field Value
Output Folder @{export_folder}
Filename paid_orders_@{DATE}.csv

Variables in the Output Folder and Filename

@{name} and @name both work; the braces make it unambiguous where the name ends, which matters as soon as a letter follows it.

4. Execute, then look at the folder

Execute. In your export folder there's now paid_orders_2026-09-24.csv — with today's date. Run it again tomorrow and you'll have two files side by side.

Expected result

  • The log shows orders: 3000 rows, paid_orders: 2682 rows, daily_export: 2682 rows.
  • One file named paid_orders_<today's UTC date>.csv in the folder you set, with 2,682 paid orders and a header.

Common pitfalls

'daily_export': variable @{export_dir} is not defined, so the output path can't be built. The variable name in the path doesn't match any variable — @{export_dir} instead of @{export_folder}, say. Odara stops before writing anything. Check the spelling against Resources ▸ Variables (or the pipeline's Variables tab).

The date is a day off. Built-in dates are UTC. If that matters, make the date part of your own variable instead.

Every run overwrites the same file. The date variable isn't in the Filename, or you used @DATE in the folder and a fixed name in the file. Either works — @{export_folder}/@{DATE}/paid_orders.csv gives one folder per day — as long as the date is somewhere in the path.

What you built

A pipeline with no hard-coded paths: it runs anywhere the variable is defined, and every run leaves its own file. World 4 uses the same mechanism for database connections, where hard-coding is worse — it's where passwords live.

Check yourself

One question, drawn from a larger bank. Get it right to pass.

  1. Why use a variable for the export folder instead of typing the path?