Forum Discussion
Transform Sample File: Add Column>Custom Column to add "File Name"
- 3 years ago
Hi ryan1919
Here is an alternative solution. You need to create a "Transform Sample File" function manually instead of using the function & queries generated automatically by Combining binary column [Content].
First connect to a CSV file using Text/CSV connector. Treat it as a sample file and transform it per your need. For example, below is my sample query Jan (sample file).
Duplicate the sample query, then modify its code like below. I convert this query into a custom function with two parameters FileName and FolderPath. These paramters are used to connect to a CSV file and FileName is used to add a custom column which displays the file name.
Then connect to the folder using Folder connector. On the Source step, remove other columns except [Name] and [Folder Path]. Invoke the custom function created earlier to add a column. Use [Name] and [Folder Path] to provide values for the parameters.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi ryan1919
If I get your Idea correctly you can use this follow up:
Click the gear and make sure the Source Name column is visible. This is the file name.
At that point, your final query will have the file name imported, and you can manipulate it like any other column.
By the way for more help use this link: