Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Bendelyon
Frequent Visitor

Get and use metadata in a pipeline

Hello 

 

I'm on a MC fabric project and i use notebook to concatenate severals csv. I would have an other way to do this.

I want ton use pipeline and the get metadata activity.

The folder architecture is on 3 folder level. 

Example 

Parent folder / child folder / csv 

 

How should i use a pipeline and a for each activity to get the metadata and could copy the csv ?

 

Thanks for help

1 ACCEPTED SOLUTION

Hi @Bendelyon,

 

In that case you could also use a Get metadata activity before the for each to retrieve your structure first and use that as items in your for each loop instead of the variable I proposed.

 

Here is a YouTube video which shares such an approach: https://www.youtube.com/watch?v=EU6Ex9EhWyA

 

View solution in original post

7 REPLIES 7
Expiscornovus
Resolver III
Resolver III

Hi @Bendelyon,


With in the for each activity you can use an array. With in the for each you can reference to items of that array via the Dynamic content. A reference would be:

@item()

https://learn.microsoft.com/en-us/azure/data-factory/control-flow-for-each-activity#create-a-foreach...

 

Below is an example to demonstrate this with the Get metadata activity

 

1. Example Folder structurecsvlakehouse.png

 

2. Array variable 

 

csvarray.png

 

3. Usage of variable in For Each Items property

@variables('CSVArray')

 

items_variable.png

 

4. Reference to item of array in GetMetadata activity

@item()

 

getmetadata_activity.png

5. Test run pipeline

 

testrun_getmetadata.png

Hello

 

Thanks for your help and for five me the "logical" to think.

However i have many parent folder.

Example 

Parent folder a / child folder a / csv

Parent folder b / child folder a / csv 

Etc

 

I need to iterate on thé parent folder to enter on the child folder ans get the csv whitch is on.

 

Thanks for your help

Hi @Bendelyon,

 

In that case you could also use a Get metadata activity before the for each to retrieve your structure first and use that as items in your for each loop instead of the variable I proposed.

 

Here is a YouTube video which shares such an approach: https://www.youtube.com/watch?v=EU6Ex9EhWyA

 

Hi @Bendelyon ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .
Otherwise, will respond back with the more details and we will try to help .

Hi @Bendelyon ,

Glad to know that your query got resolved. Please continue using Fabric Community on your further queries.

NandanHegde
Super User
Super User

Do you mean to concatenate all the CSV files into a single CSV file ?
Then the below blog acts as a sample reference :

https://www.c-sharpcorner.com/article/merge-multiple-json-files-via-synapse-data-factory-pipelines/

 

wherein you can use the Copy activity recursive and merge into single property

Hello

 

My principal problem is to get metadata to navigate onto the folder structure.

 

Thanks

Helpful resources

Announcements
April Fabric Update Carousel

Fabric Monthly Update - April 2024

Check out the April 2024 Fabric update to learn about new features.

Top Kudoed Authors