---
title: "Dynamic File Naming Patterns"
slug: "dynamic-file-naming-patterns"
description: "Utilize dynamic file naming patterns and partitioning in Dataddo to automatically locate source files and generate organized output files for data flows."
updated: 2025-07-24T18:38:56Z
published: 2025-07-24T18:38:56Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dataddo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Dynamic File Naming Patterns

Dataddo supports **dynamic file naming** when creating ***data sources*** and ***data flows***, giving you control over how files are created using variables like dates or object identifiers.

Depending on the use case, this feature serves two purposes:

- **File Naming Patterns**: Used when configuring ***data sources*** to locate and extract the correct input file.
- **File Partitioning**: Used in ***data flows*** to organize output data into multiple files based on time or other variables.

## File Naming Patterns (for Data Sources)

When setting up a **file-based data source** (e.g., from [Microsoft OneDrive as a Source](/docs/microsoft-onedrive-source)), you can define a dynamic file name to automatically match files that update daily or periodically.

This is ideal for systems that generate a new file each day and can embed the date in the file name.

### Dynamic Variables for Sources

Below, you will find all supported dynamic variables for ***data sources***.

| Variable | Description |
| --- | --- |
| {{today}} | Current date |
| {{yesterday}} | Previous day’s date |

You can change the date format using [date string formatting](/docs/dynamic-file-naming-patterns#date-string-formatting), e.g.:

- `{{today|Y-m-d}}` → `2020-01-31`
- `{{yesterday|d_m_Y}}` → `31_01_2020`

**Example** For a file name like `sales_data_20200101.csv`, you can use the following name pattern:

```
sales_data_{{today|Ymd}}.csv
```

## File Partitioning (for Data Flows)

File partitioning splits large datasets into smaller, manageable partitions, based on criteria like date. This technique enhances data organization, query performance, and management by grouping subsets of data with shared attributes.

When configuring a data flow that outputs data to a **file-based destination** (e.g., [SFTP Server](/docs/sftp-server) or [Microsoft OneDrive](/docs/microsoft-onedrive)), you can define a custom file name pattern to partition the output.

**Example** You can use either [**dynamic variables**](/docs/dynamic-file-naming-patterns#dynamic-variables-for-flows) or [**dynamic date ranges**](/docs/dynamic-file-naming-patterns#dynamic-date-range-for-flows) in your file names and change the the date format using [date string formatting](/docs/dynamic-file-naming-patterns#date-string-formatting), e.g.:

- `{{today|Y-m-d}}` → `2020-01-31`
- `{{yesterday|d_m_Y}}` → `31_01_2020`
- `xyz_{{1d1|Ymd}}` → `xyz_20200131`

### Dynamic Variables for Flows

Below, you will find all supported dynamic variables for ***data flows***.

| Variable | Description |
| --- | --- |
| {{today}} | Current date |
| {{yesterday}} | Previous day’s date |
| {{dateRangeStart}} | Start date of selected range |
| {{dateRangeEnd}} | End date of selected range |
| {{objectId}} | ID of the processed object |
| {{objectLabel}} | Label or name of the processed object |

### Dynamic Date Range for Flows

Use expressions like `{{1m1}}` (last month) or `{{90d1}}` (90 days ago through yesterday) to define **custom ranges**. The syntax `{{&lt;start&gt;&lt;unit&gt;&lt;end&gt;}}` breaks down as:

1. **Start**: Number of units back from today (e.g., `1` month ago).
2. **Unit**: `d`=day, `w`=week, `m`=month, `y`=year.
3. **End**: Number of units back marking the range’s end (must be ≤ start).

| Expression | Meaning in ISO 8601 |
| --- | --- |
| {{0d0}} | Today |
| {{1d1}} | Yesterday |
| {{1d0}} | Yesterday and today |
| {{0m0}} | This month |
| {{1m1}} | Last month |
| {{90d1}} | 90 ago until yesterday |
| {{1w1}} | Last week |
| {{0w0}} | This week starting from Monday |
| {{0y0}} | This year |
| {{1y1}} | Last year |
| {{1d1\|U}} | Yesterday in Unix seconds |

## Date String Formatting

Specify the **date string format** used in your dynamic file name by applying standard [strftime](https://strftime.org/) patterns. This determines how the date appears when inserted into the file name.

| Expression | Output |
| --- | --- |
| {{0d0\|Ymd}} | 20201231 |
| {{0d0\|Ydm}} | 20203112 |
| {{0d0\|d/m/Y}} | 31/12/2020 |
| {{0d0\|Y-m-d}} | 2020-12-31 |
| {{0d0\|Y-m-d\TH:i:s}} | 2020-12-31T00:00:00 |
| {{0d0\|U}} | 1698403939 |

A source is a collection of data from an authorized service that's been connected via a Dataddo connector. Data within the source is automatically refreshed based on the source's configuration.

Data flows allow you to orchestrate the integration of your data from various sources to your desired destinations. You may add multiple data sources with the same schema to one flow to merge data for a consolidated output.
