ADF -GetMetadata show file exists even if file is not present

Khushboo Dubey 21 Reputation points

I have a folder in which there are many files (txt files) ,I am using GetMetadata to check if any file exists or not.
so in data set I mention
but even if no file exists it give exists=true


How to dynamically provide filename ?as I tried giving *.txt but this also fail

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

Accepted answer
  1. AnnuKumari-MSFT 30,361 Reputation points Microsoft Employee

    Hi @Khushboo Dubey ,
    Thankyou for using Microsoft Q&A platform and posting your query.

    Since the dataset is pointing to a folder in your case, it is checking the existence of the folder (not the file within) . The reason being you have set the file name as blank. Now, to your question - How to get the list of .txt files in a specific folder .

    There is no option to use wildcard in GetMetadata activity . So , *.txt won't work. So, a better workaround is to get the list of all files from a folder using GetMetadata(childItems) and then use filter activity to get .txt file names.

    Hope this will help. Please let us know if any further queries.


    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you.
      Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Samy Abdul 3,366 Reputation points

    Hi @Khushboo Dubey ,this was a bug around 3 years back, which has been addressed successfully. Did you double check whether you are

    inadvertently passing on the file path. As far as passing dynamically filename you should leverage parameters: Thanks