How can I get the the folder name of the file in the Get MetaData function.
As itemname I get this as result "*", since I have a wildcard in the connection settings of the source dataset. The folder structure is like this: project/location/file and would like to have location passed aswell.
Is it possible to pass like '/location/file.tdms' or pass the location in the next step which is an iteration (ForEach)?
CodePudding user response:
You can provide the project folder name under the container as shown below and use the Get Metadata
activity to get the list of folders under the Project folder.
- Select Child items under Field list in the
Get Metadata
activity to get the folders under the project.
The output of Get Metadata:
- Connect the
Get Metadata
activity output to theForEach
activity to loop the current item and get the files under the location folder.
- Add an activity in ForEach to process the files of the current ForEach item. Here as an example, I am using another
Get Metadata
activity to show the list of files under location (output folder of Get Metadata1).
- Create another source dataset locating to same container/project, and parameterize the directory & filename.
- In Get Metadata2, pass the current item name (output folder name of Get Metadata1) in directory parameter and specify (*) in file_name parameter to get the files list with the Filed list as child items.
The output of Get Metadata2: