none
Get File Name from OnPremises Folder using Get Metadata Activity

    Question

  • Hi,

    I am looking to get FileName from FileSystem, wherein one folder I am having a file like below

    Address_YYYYMMDD.csv

    City_YYYYMMDD.csv

    Now My task is to I have a single copy task in my pipeline where I should pass filename value like Addr and it should pick Address_YYYYMMDD.csv file from the source folder and copy to target dataset using Get MetaData Activity.

    I am trying to use Child Item event under <g class="gr_ gr_623 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" data-gr-id="623" id="623">Get</g> Metadata activity

    But I don't how to take the name of a file where type=file in one of variable


    Thankx &amp; regards, Vipin jha MCP

    Friday, April 5, 2019 1:52 PM

All replies

  • I want to get the only name of the and pass to one of Variable so that I can sue in my Copy activity in the source  file as shown in below screenshot


    Thankx &amp; regards, Vipin jha MCP

    Friday, April 5, 2019 2:40 PM
  • Hi Vipin,

    I would suggest you to have a setVariable activity in conjunction with the getMetadata activity. In the setVariable activity, you can have an expression similar to :

    @activity('Get Metadata1').output.childItems[0].name   (this will get you the name of the first child)

    In case you multiple files, you can use a forEach activity or a custom activity in conjunction with the getMetadata activity.

    Hope this helps.


    MSDN

    Thursday, April 18, 2019 11:10 AM
    Owner