 Hey guys, welcome to SSU Detects, so see this side and today we are going to see about the fail activity. So what is the fail activity and where we can use that. So before going forward if you haven't watched the last video of this video series that is stored procedure activity. So I would strongly recommend to watch that video because this is the continuation of that video. If you are not going to see that video then it is little bit difficult to understand about the fail activity. So I will provide the link of that video in the description of this video. So what is the fail activity? So you might occasionally want to throw an error in the pipeline internally. A lookup activity might return no match output data or the custom activity might finish with an internal error. Whatever the reason might be now you can use the fail activity in the pipeline and customize both its error message and error code. So this is the use of the fail activity. So in our example we are having a blob storage. So for example this is the blob storage which is having the file. So here we are having the employee file. So we want to load the data from employee file to Stikosower table. So first we are using the get metadata activity. By using this activity we can directly get the employee filename from there. Next we can use the if condition activity and if condition activity we will be going to check whether your file is available or not. So in the get metadata activity we will be having option for the exist. So one of the properties exist so it is indicating whether a file is available in your source or not. If file is there we can go in the if condition activity and under the if condition activity we are checking if this exist value is true. Then we directly want to load the data. If this exist value is not true then we are executing one of the store procedure that is indicating your source is not having the file. This is what we have done in the last video. So go to on the browser and we will try to see what we have done in the last video that is the store procedure activity. So in the store procedure activity what we have done we were checking one of the file at the source that is the EMP file if that file is there or not. So for that we are using the get metadata activity with the exist property. So if the file is there then we just want to load that into the SQL server table. So inside the true we can use the copy data activity that we have already gone through multiple times. If the file is not there then under the false what we have done we have used one of the store procedure activity. So the store procedure activity is loading the data into the SQL server table and that is the log data which is saying your file is not there. So here we can use the fail activity to fail this pipeline. So this is because if we can go here and after this if condition if we are having any another activity here we do not have but in the real time we should have. So if we have one more copy data activity after this if block and we will be having one more so it will be executing like these two will be executing and the file is not available at the source. So as per the requirement if file is not available at the source we do not want to execute these two copy data activity. So we can forcefully stop your pipeline. So here we can simply use fail activity and under the setting we can simply return some fail message and error code. So here like the file is not at the source and the error code we can write anything like one, zero, two like this. So this is the fail activity. Let me try to remove this copy data activity otherwise it will throw an error. Let me try to debug it now. So it will be executing your pipeline will be failed. So let me refresh it as we have already deleted the file at the source in the previous video. So file is not there. So the exist will be false. So we can go and check the output of the get method activity exist value is false. So it went under the stochastic activity and after that the fail activity. So here we can see the stochastic activity. So that is completed with success and if we can go under the fail activity then it is saying this is the customer that we have generated. So the file is not at the source. So this is we have already written under the fail activity. So your pipeline will stop will not be executing then after we can verify like we can use the wait activity after this and now let me try to debug it. So you can verify like after this we are not executing any activity. So this time your pipeline will be stopped till the if condition activity. So here if condition activity is executing fair activity so it got failed and as we can see the wait did not executed. So this is just because of we have created the fail activity here and failed the pipeline. So this is the actual use of the fail activity. 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.