Unable to implement getmetada and foreach , copy actvity

Krishnamohan Nadimpalli 401 Reputation points
2022-08-24T09:10:21.17+00:00

I have a source which has 3 files in the folder

234390-image.png

I want to iterate through them and use copy activity to put them into sql db. Sink side only one table.

Problem is on the source side to get the file name. Following are the settings

GetMetadata Activity Dataset settings

234358-image.png

ForEach Activity settings:
@activity('Get_Metadata_For_Perfect_Store').output.childItems

Copy Source dataset settings

234369-image.png

Copy Source Settings:
234453-image.png

But I am unable to get filename in the source.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,488 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Suba Balaji 11,186 Reputation points
    2022-08-24T09:53:26.43+00:00

    Hi,

    Inside foreach loop, you need use under source file name parameter

    @item().name

    This will be bringing the filename of each file while the loop iterates through files.

    You may refer this video, which does something similar.

    Please write, in case you need more clarity.