Forum Discussion
Warning When Attempting to Dynamically Name the Destination File During Export
Hi,
I am using a Copy activity to extract data from a Lakehouse table by executing a SQL query in the Source section, and I am exporting the results as a CSV file. When I attempt to dynamically assign a name to the output file, I receive the warning shown in the image below.
What are the best practices or supported methods for handling dynamic file names in this scenario? Any assistance would be appreciated.
In Fabric pipelines Copy activity currently does not support building a single dynamic file name directly in the File Name box, because that field expects an object, not a raw string expression. The supported pattern is to write into a dynamically named subfolder and let copy activity create the default file name or use a ForEach with a Set Variable plus a Dataflow/Notebook as the sink to write a fully custom name. If you must control the file name, the practical approach today is to push the naming logic into a Notebook (df.write.csv with your generated name) or into a DataflowGen2 because Copy activity does not yet allow explicit dynamic file naming.
Hi Jher12
The File Share sink uses a fixed path, so this won't work. Either use Dataflow Gen2 to write to on-premise or write to OneLake and make files available using OneLake Explorer.
4 Replies
- Vinodh247Super User
In Fabric pipelines Copy activity currently does not support building a single dynamic file name directly in the File Name box, because that field expects an object, not a raw string expression. The supported pattern is to write into a dynamically named subfolder and let copy activity create the default file name or use a ForEach with a Set Variable plus a Dataflow/Notebook as the sink to write a fully custom name. If you must control the file name, the practical approach today is to push the naming logic into a Notebook (df.write.csv with your generated name) or into a DataflowGen2 because Copy activity does not yet allow explicit dynamic file naming.
- deborshi_nagSuper User
Hi Jher12
What type of connection is your destination? If you try writing to a /Files section of a Lakehouse in OneLake using a Fabric Copy activity inside a Pipeline item, it WILL definitely work!
Hope this helps - please appreciate by leaving a Kudos or accepting as a Solution!
- Jher12Frequent Visitor
Hi deborshi_nag
Destination - on premise file share- deborshi_nagSuper User
Hi Jher12
The File Share sink uses a fixed path, so this won't work. Either use Dataflow Gen2 to write to on-premise or write to OneLake and make files available using OneLake Explorer.