Forum Discussion
How to get datepart in Expressions
- 1 year ago
Hi CeeVee33 , Thank you for reaching out to the Microsoft Community Forum.
- To dynamically create the folder path and filenames based on today's date in Microsoft Fabric Pipelines, you can use the following expressions directly in the pipeline.
Folder path: @concat('\\Servername\ABCFolder\',
formatDateTime(utcNow(), 'yyyy'), '\\',
formatDateTime(utcNow(), 'MMMM').ToUpper(), '\\',
formatDateTime(utcNow(), 'dd.MM.yyyy'))
Output: \\Servername\ABCFolder\2025\MARCH\20.03.2025
Example File1: @concat('MyFirstFav_', formatDateTime(utcNow(), 'ddMMyyyy'), '.csv')
Output: MyFirstFav_20032025.csv
Example File2: @concat('MySecondFav_', formatDateTime(utcNow(), 'ddMMyyyy'), '.csv')
Output: MySecondFav_20032025.csv
- To Ingest Multiple CSVs into a Table in Fabric, create a Pipeline, use a Get Metadata activity to list the files in the dynamic folder path. Use a ForEach Activity, Iterate over the file list. Copy Data into a Table, Use a wildcard file path: \\Servername\ABCFolder\@{formatDateTime(utcNow(), 'yyyy')}\@{formatDateTime(utcNow(), 'MMMM').ToUpper()}\@{formatDateTime(utcNow(), 'dd.MM.yyyy')}\*.csv . Configure the Sink, point to your Lakehouse table, Use Auto Mapping to map CSV columns to table columns. Add a Trigger, set the pipeline to run daily.
- Try these learn documents:
Module 1: Create a pipeline with Data Factory
Lakehouse tutorial: Ingest data into the lakehouse
Ingest data into your Warehouse using data pipelines
If this helped solve the issue, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
Hi CeeVee33 , Thank you for reaching out to the Microsoft Community Forum.
- To dynamically create the folder path and filenames based on today's date in Microsoft Fabric Pipelines, you can use the following expressions directly in the pipeline.
Folder path: @concat('\\Servername\ABCFolder\',
formatDateTime(utcNow(), 'yyyy'), '\\',
formatDateTime(utcNow(), 'MMMM').ToUpper(), '\\',
formatDateTime(utcNow(), 'dd.MM.yyyy'))
Output: \\Servername\ABCFolder\2025\MARCH\20.03.2025
Example File1: @concat('MyFirstFav_', formatDateTime(utcNow(), 'ddMMyyyy'), '.csv')
Output: MyFirstFav_20032025.csv
Example File2: @concat('MySecondFav_', formatDateTime(utcNow(), 'ddMMyyyy'), '.csv')
Output: MySecondFav_20032025.csv
- To Ingest Multiple CSVs into a Table in Fabric, create a Pipeline, use a Get Metadata activity to list the files in the dynamic folder path. Use a ForEach Activity, Iterate over the file list. Copy Data into a Table, Use a wildcard file path: \\Servername\ABCFolder\@{formatDateTime(utcNow(), 'yyyy')}\@{formatDateTime(utcNow(), 'MMMM').ToUpper()}\@{formatDateTime(utcNow(), 'dd.MM.yyyy')}\*.csv . Configure the Sink, point to your Lakehouse table, Use Auto Mapping to map CSV columns to table columns. Add a Trigger, set the pipeline to run daily.
- Try these learn documents:
Module 1: Create a pipeline with Data Factory
Lakehouse tutorial: Ingest data into the lakehouse
Ingest data into your Warehouse using data pipelines
If this helped solve the issue, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.