Home > Mobile >  change itemname: "*" to parent folder of the file [Azure Data Factory]
change itemname: "*" to parent folder of the file [Azure Data Factory]

Time:10-27

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)? enter image description here

enter image description here

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.

enter image description here

  1. Select Child items under Field list in the Get Metadata activity to get the folders under the project.

enter image description here

The output of Get Metadata:

enter image description here

  1. Connect the Get Metadata activity output to the ForEach activity to loop the current item and get the files under the location folder.

enter image description here

  1. 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.

enter image description here

  1. 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.

enter image description here

The output of Get Metadata2:

enter image description here

  • Related