 Hello, welcome to SSUnitex to see this side and this is continuation of SEO Data Factory interview questions and answers. So recently one of my subscriber has attended interview with the TCS and these two scenarios was asked there. So I am going to cover the second scenario in this video. So as per the second scenario, we are having different CSV files in the ADLS location. And those files are having something like the India, Australia, England, South Africa cricket teams. So for example, if any tournament is going to happen, then all those schedules will be on that particular Excel file. So that Excel file or the CSV file will be having the combination like India will be going to play with Australia. So that will be in the one file. India will be playing with the England and that will be the second file. So such type of files we are having and the requirement is we want to fetch only India cricket team related files from the pipeline. So we have to design a pipeline and on that pipeline we have to fetch only for the India related files. If India is going to play with Australia or South Africa or any another team, then we have to fetch out that particular file. So let me quickly go into the browser. So inside the browser, I have inside the blob storage. So inside this input container, we are having these five files. So in these files, we can see the name of the files which is having the schedule. So Bangladesh versus England schedule, India versus Australia, India versus New Zealand, Sri Lanka versus New Zealand and West Indies versus South Africa. So as per the requirement, we have to fetch out only India related file which is the second and third file and we want to copy these two files from this input location to the output containers. So here as of now, we can see we are having these three folders. So outside this, we should be copying those two files. So we need to design one of the pipeline. So how we can design the pipeline? So first as we can see inside the input container, we are having all these files. So by using the get metadata activity, we should be getting all these files. And then after by using for each activity, we will be looping through all the files one by one. And then by using the if condition activity, we will be checking if the name is having India or not. If the name is India, then we will be using the copy data activity to copy those files into the output location. So this is we are going to implement in this video. So inside data factory, I am going to create a new pipeline. And here in this pipeline, first as I told you, we have to use the get metadata activity. So this get metadata activity will be going to get all the files. So we have to select the data set. So I am going to create a new data set here. It is pointing to Azure Blob Storage. So we can select then delimited text. And then we have to select the link service. So I am going to use this link service underscore employee. So this is pointing to same location. Let me browse for the path. Here we need to select the input location. And without selecting any file, we can just click on OK. So it is pointing to input location. First row as header, we can select this checkbox. And after that we can click on OK. So it will be creating a new data set. And this data set is pointing to the input location of the Blob Storage. And we can see the field list. So we should be selecting the child items. So what child item will be doing? Child item will be going to get all the files under the input location. So child item means whatever the available files inside the given location that is input. So let me try to debug it and I will show you all these files should be appearing here. So as we can see it got executed successfully inside the output. We should be seeing all those child items. And we are having the name property and the type that is the file. So under the name property, we are having the file names. So all the files are here. Next we have to go one by one for each file and then we should be going to check. So for looping all these we should be going to use the for each activity. So inside the for each activity go under the setting and here we can see the items. So under the item we have to use the child item of the get metadata one. We can click on OK. So next inside the for each we have to use the if condition activity. So what if condition we will be doing? If condition activity will be checking whether your file name that we are getting under this particular for each those are having India there or not. So we have to check inside the if condition activity. So here we can simply go inside the activities and under the activity we can see expression. So inside the expression we can see we are having this item property with the name. So if this value contains India then that will be true otherwise false. So here we can use the function under the functions we can search for the contain. So here we have the contains we can select it and if your for each name will be containing India then we want to use those files. Let me click on OK. So if that will be true. So under the true we should be going to use the copy data activity for copying those files. So here we have to set up the source and sync. So both source and sync will be dynamic because the file names that we are getting so those are coming by using this for each activity. So inside the for each activity we are having item dot name property. So by using that property we are receiving the file names. So go to on the source and here let me create the source data set and this is for the blob stories. So we can select the blob stories click on continue delimited text click on continue. Here link service we can select the same. We can browse till the input location and we can click on OK. So it is pointing to input location but the file name that should be coming from the for each activity. So here we don't have any property by which we can make it dynamic. So we can click on OK. Here we can click on open. So here we should be seeing property for making this as dynamic content. So before going to make this as dynamic we can go in the parameter and we will create one parameter and let me call the source file name and go in the connection and inside this we can use that particular parameter and click on OK. After making this change once we back to the pipeline here we should be seeing the data set is asking about the file name parameter. This should be going to pass from your for each activity but here we cannot see for each activity but we can use that for each activity by writing item then start the bracket dot we can use the name property. So it is not a label here but we can use it let me click on OK. So that looks OK go to the sync and here let me add a new data set and this is pointing to the output location. So we can use the same link service and this time we want to keep the file into the output location click on OK again we need to make the file name as dynamic. So we can click on OK and after creating this we can open it and here we can create a new parameter. So this is for the sync file name and inside the connection we simply go and select this sync file name click on OK. So after making this change once we back to the pipeline it should be going to ask this parameter. So again this parameter value we should be getting from the for each activity explicitly you have to write this otherwise it is not available here let me click on OK. So we have done each and everything let me quickly go inside the pipeline and try to debug it. So once it will be executed your files should be going to copied and those files copied which are having name as India. So we will be going to wait until this will not be executed. So here as we can see it got executed successfully let me go and try to see one by one. So inside the get metadata here we can see all these child items. So those are one two three four five and after that we can see for each so for each will be receiving total five counts. So it means it will be executed five times as the child item is five next if condition will be executed for five times and then if that is true. So as we can see two files are having India. So those will be going to copy. So first is going to copy here and the second file will be going to copy here. Let me quickly go into the output location and I will show you like those two files should be copied as we can see these two files has been copied here. So by using this approach you can copy these two files. So I hope guys you have understand how we can achieve this for the source data. You can simply create these XLS file without having any data in the file for your practice purpose and you can call the name like I have used here. Thank you so much for watching this video. If you like this video please subscribe my channel and press the bell icon for getting the notification of newly uploaded videos. See you in the next video.