 Hey guys, welcome to SSNIT at social design and today we are going to see about the forage activity In the previous two videos of this video series We have discussed about the get metadata activity and after that we have discussed about the filter activity So if you haven't watched those two videos while strongly recommend to watch that video before going forward I will provide the link of those videos in the description of this video So what is forage activity? So the forage activity defines a repeating control flow in the SEO data factory or snaps pipelines The activity is used to iterate over the collection and executes a specified activity in a loop The loop implementation of this activity is similar to the forage looping structure in programming languages So basically it will be going to accept a input and that will be the array and Based on the array values, it will be going to loop through one by one So this is the main purpose of the forage activity So in the previous video, we have already created this pipeline. Let's understand about the requirement first So as per the requirement here, we are having a container and under this container We are having four files. So first two files are employee files and other two are the payroll files So we just want to load these files into the sequence of a tables. So this is the requirement So how we can do that because employee file is having different data structure and payroll file is having different data structure So for this we have already created this ADF pipeline Where in the get meta data, we are going to get all these four files and in the filter activity We are splitting employee and payroll files. Now as we have seen we have two employee files So we have to use the forage activity. So forage activity is going to look through one by one Among these two. So let me connect with this filter activity and this forage. Let me call this as forage for Employee now Here in the settings, we can see the items. So in the items, we can select the employee output of this Filter activity. Now, let me think on okay. So we are done with the forage activity similarly, we have to do One more forage activity and that for each activity for the payroll. So let me connect with the payroll here and Now let me call this forage for the payroll and In the setting this time The item that should be the output of the filter Activity of the payroll. So this is the output. Let me click on okay So we have done with the forage activity now under this forage activity We are required to use the copy data activity. So let me go by clicking on this pencil icon and Here we have to use the copy data activity. So this copy data activity is for Employee. So let me call this as employee now go to on the source and Under this source, we have to create a data set So you are more concerned to creating the data set because this data set should be dynamic and It will be going to get the file names from the forage Activity so let me create a new data set and this is for the as your blob stories Click on continue delimited testify Click on continue here. Let me call this as For each employee So it is not So we can remove this so for each employee now in the link service We have already created the link service For the get metadata. So I'm going to use the same. So let me go on the browse so we are in the root folder and Under this input folder, we are not going to select any file here because these files Will be getting from the forage. So we can click on okay So this will be going to set a letter. Don't worry for this now. Let me click on okay So we have created this data set now click on this open and here we need to create one parameter and By passing the values on that parameter Inside the file. So first, let me create a parameter and call this as file name Go to the connection Under the file, let me select that So everything is okay till now now go back to the previous step and Here now we can see under the data set property is the file name. So this parameter value it is asking So from where we will be going to getting this File name value. So this should be on the output of the for each So let me go on the add dynamic content. So here we can see this for each for the employee only after that dot name so That is okay. Now we can click on okay So we have set up for the source. Let me go on the sync side and here Let me create a new one and This would be the as yours equal Let me click on continue as we have already Link service for as yours equal SSU prod because our tables are in prod database So SSU prod and these two tables are there for the employee data and pay So here we need to select the table name. So that is the employee data for sure and Here we can call this as For each employee It's already there. So for each underscore employee Let me click on okay So we have set up everything and One thing that we did not set up. So we need to go back here the first row of The file that is the column names. So here we can see the first row as header So we need to set this like that So we have done for the employee We have to do the same thing for the payroll as well. So let me go quickly here Let me drag and drop copy data activity and here. Let me call this as copy data for payroll Go to the source Now click on new Here, let me go on as your blob stories as the source Delimated file Link service we have already created that is get metadata First row as header, we can select it here Now for the file path, we need to browse. So let me browse it Go to the input Don't select any file click on okay directly again So we have set up this data set now we can directly click on this open and Here we have to create the parameter as I told you earlier So that should be the file name and here We can go back and it will be asking the file name here. So this should be coming from the Output of this for each pay. So that looks okay, and this should be dot Name so this will be the complete one click on Similarly go to the sync site Click on new and this would be as yours equal Click on continue Link service we have already created and the table name that is the pay and click on okay So we have done for the payroll as well go back to the metadata Now we can execute this and it will be getting the files and loading into the required tables So let me debug it. So copy data pay Location is empty. Okay, so let me Go back there in the copy data So for this we can go directly in the delimited text to so this file location is empty as we have created the Parameter here. So this parameter should be mapped with this file So let me go here and add this file. So now everything looks good. Let me try to debug it now So this should be executed and data should be loaded in the required tables. So it's running now Get metadata activity is executed. So filter activity is completed along with the get metadata For each activity is executing now and here we can see the copy data activity is executing in below of this output So similarly we can see Copy data is in progress So copy data pay is completed employees executing So all these are completed successfully. So now we can go in the SSMS and we'll try to check the tables So now tables should have the data as we can see it has six rows and this is our again having the six rows So, thank you so much for watching this video. If you really like this video, please subscribe our channel to get many more videos Don't forget to press the bell icon to get the notification of our newly uploaded videos. See you in the next video