 Hey guys, welcome to SSUnitech, so till this side and this is continuation of Azure Data Factory tutorial. So today we are going to start with the anti-lactivity. So what is the anti-lactivity and where we can use it in the real time? So before going forward, if you haven't watched the previous videos of this video series, so I would strongly recommend to watch all those videos in a sequence. So for that you can directly go in the browser and you can search for SSUnitech in the YouTube and after that you can go here then go under the playlist and here you will see the playlist for the Azure Data Factory. So you can open that one and you can watch all those videos which is related to the Azure Data Factory. So let's get started with the today's videos. So what is anti-lactivity? So basically the anti-lactivity provides the same functionality that do until loop structure provide in the programming languages. If you don't have the idea about the programming languages then don't worry you will see in this video. So here we will be going to have a condition. This loop will be executing until that condition will not reach. So this is the anti-lactivity. So it executes a set of activities in a loop until the condition associated with the activity evaluated to true. So as I told you we will be having a variable and that variable value will be false by default and your loop will be executing until that variable value will not be true. So for that we have to use the until activity. You can also specify a timeout value for the until activity. So for example your loop will be executing for 1 hour and if the value is not going to get true for that variable then your pipeline will be completed. So we can set the timeout. So what is our requirement? So let's try to understand our requirement and where we can use this until activity in the real time. So we want to load the data from the azure blob storage. So this is the azure blob storage. So here we have this employee.txt file. So this employee.txt file is available right here. So in your case that will not be there. So this might be uploading at this source location for any specific period of time. So before going to execute the copy data activity to load the data from this emp.txt file to the sql server table first we want to check whether this file is available there or not. So this is the case if this file is not there and you want to execute the copy data activity then your pipeline will fail. So this is the something validation we can check before going to process the data. So here we can see the data. So it has total four columns employee id name address and department and total three rows. And we want to load this file into the sql server table. So as of now we have this file but later we will be going to delete this file and will execute the pipeline. So how we can use the until activity there. So first we will be declaring a variable and by default the value of that variable will be false. And in this until activity first we will be using the wait. So we just want to wait for five minutes, 10 minutes as per your requirement you can set. In my case I will be going to set for 10 minutes. So after that this pipeline will be paused for 10 minutes and will proceed further after 10 minutes. Inside the get meta data activity we will be going to check whether the employee.txt file is there or not. If that will be there then we have this if condition. So if file is there then inside the if condition we have the true block and inside the true block we will be going to set the variable which is for the until activity as true. So this until activity will not be executed again. So this is the condition for checking the file availability inside the azure blob storage. Now go to the browser and we will try to implement this in practical. So here let me try to add a new pipeline. Let me call this as demo until activity. Now here first as I told you we need to drag and drop the until activity. So we can drag it here and in this until activity here we have to set. So under the expression we can go and here we can set the value for the variable but first we have to declare a variable. So go to the pipeline level and let me add a variable for the status and default value of this is false. Now inside this until activity go to the expression and we want to execute this loop until this status value will be true. So for that we can use the bool like this and this. So until this variable value will be true then your loop will be stopped otherwise this will be executing continuous. Now inside the activity what we need to do. So under this first as I told you we have to use the wait. So it will be waiting let me assume for 10 seconds in our case because we don't want to wait longer time. After that we have to use the get metadata activity. So we can drag and drop it here and let me try to connect with this wait and in this get metadata activity what we need to do go to the settings and we need to create a data set and that data set will be pointing for this employee file. So let me try to go on the new and this is for the blob storage. So we can select comma delimited file that is okay and here we need to select the link service. So in the previous videos we have already created the link service for the get metadata. So that will be pointing for that particular location for this input location. Now here we can see the file. So we can go under this input and we need to select that file directly. Now that is okay we can click on okay. So we have done with this get metadata activity. Next we need to check whether the file is there or not. So for that we have to use the if condition and before if condition in this setting we can see the field list. So we can click on new and under the argument we can check the exist. So if file will be there then this exist value will be true otherwise this will be false. So that will be under the field list. Now we can connect with the if condition. Under the if condition go to the activities and under the expression here we need to check the output of this get metadata. So this is for the exist. So we can also check this as true. So we can set like bool of this. So this will be true then under this true log we need to use the set variable activity. So this set variable activity will be going to set the value of this status variable as true only. So that is it. So what this until activity will do this until activity will be executing until your file will not be there. Under setting tab we can also set the timeout option. So I am not going to set this in my case. Next we need to use the copy data activity. So we can connect with this. Now we need to select the source and destination. So as I have already created the source for this. So let me go into use the same one in the sync. I have already created the sync location as well. So for saving the time, so let me go into select that one. Now go to the mapping and import the scheme from there. Everything looks good. So now we can execute and we will check the output. So let me try to debug. So this time file is there. So this will be executing and will load the data at the first attempt. So we can wait. So as until activity is executing. So we can check in the output section as well. So wait activity is executing. So it will be executing for 10 seconds. So your pipeline will be paused. So as we can see here the wait activity is completed. After that get metadata activity. Let me check the output of this. So exist seems true because file is there. Now we can go in the if condition. So if condition will succeed, then set variable. Inside the set variable this status value is going to set as true. Your until activity will be completed here. Then copy data activity and loading the data. So this is like that. Now go to the Azure Blob Storage and we will try to delete this. So this will be deleting the file in the Blob Storage. Now we do not have that file. Now let me try to debug it. So this will be executing and this time file is not there. So your get metadata activity exist will be false. So we can check it here. So here we can see now we can see the output. So exist seems false. So your until activity will be starting again and again. So here we can see the if condition then wait activity is coming again. So until is repeating here as well. So this will be executing until your file will not be there. Let me try to upload the file quickly and try to upload it. So file is uploaded. Now we can go here and we will try to refresh it. So get metadata activity is executing. So again like if condition is there then wait. So after this wait your file will be there. So get metadata activity will find the file. So the exist will be true. So as we can see for this exist value is true in this case and nostad variable will be true for the status and copy data activity is executing. So this is executed successfully. So I hope guys you have better understanding. Now we can check the table. So this would have the data. So as we can see six records because we have executed points. 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.