$$FILEPATH
is the reserved variable to store the file path. You cannot add dynamic expression with $$FILEPATH
.
You have to create a variable to store the folder name as required and then pass it dynamically in an additional column.
Below is what I have tried.
- As your folder name is not static, getting the folder names using the
Get Metadata
activity.

Get Metadata Output:

- Pass the output to the
ForEach
activity to loop all the folders.

- Add a variable at the pipeline level to store the folder name.

In the ForEach
activity, add the set variable
activity to extract the date part from the folder name and add the value to the variable.
@substring(item().name, add(indexof(item().name, '='),1), sub(length(item().name), add(indexof(item().name, '='),1)))

Output of Set variable:

- In source dataset, parameterize the path/filename to pass them dynamically.

- Add
copy data
activity after set variable and select the source dataset.
a) Pass the current item name of the ForEach
activity as a file path. Here I hardcoded the filename as *.parquet
to copy all files from that path (this works only when all files have the same structure).
b) Under Additional Column, add a new column, give a name to a new column, and under value, select to Add dynamic content and add the existing variable.

- Add Sink dataset in Copy data Sink. I have added the Azure SQL table as my sink.

- In Mapping, add filename (new column) to the mappings.

- When you run the pipeline, the ForEach activity runs the number of items in the Get Metadata activity.

Output:
