Share via

Dynamically Select the files

Rohit Kulkarni 731 Reputation points
2025-01-09T18:05:31.95+00:00

Hello Team,

I need to select the files from this folder.Due to timestamp i am not able to do dynamically.IS there any way where i can select only those 3 files and run dynamically

File Path:outbound/em_dataextracts

User's image

Please advise

Rohit

Azure Data Factory
Azure Data Factory

An Azure service for ingesting, preparing, and transforming data at scale.


1 answer

Sort by: Most helpful
  1. Chandra Boorla 15,475 Reputation points Microsoft External Staff Moderator
    2025-01-16T01:52:10.39+00:00

    @Rohit Kulkarni

    To address the issue of selecting only files and excluding folders while using the "Get Metadata" activity in Azure Data Factory, you can use the following approach:

    Use the Get Metadata Activity - Get Metadata Activity, this activity can be used to retrieve the properties of the files in your folder. Field List, in the Get Metadata activity, specify the field list to include childItems. This will return a list of items in the specified folder.

    Filter the Results - Filter Activity, after retrieving the metadata, use a Filter activity to filter out only the items of type 'file'. Expression, you can use an expression like the following to filter the results - @equals(item().type, 'file')

    Use the Filtered Output in Your Copy Activity - Copy Activity, connect the output of the Filter activity to your Copy activity. Dynamic Content, in the source settings of the Copy activity, use the filtered list of files to dynamically select the files you want to copy.

    Important Considerations:

    Performance - Ensure that your folder does not contain an excessive number of files, as this could impact performance.

    Testing - Test the pipeline with a smaller dataset to ensure that the filtering works as expected before scaling up.

    I hope this information helps.

    Thank you.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.