 Hello friends. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to cover these two points related to lightning flow in Salesforce. So first is what happens when flow fails and how to analyze flow at our email. So whenever flow fails, it sends an email to the user who last modified it or created it. So we will learn how we can do these two points. Before starting, if you want to follow Salesforce training videos, you can search my name Sanjay Gupta on YouTube. And you can follow my YouTube channel and you can see various playlists are available related to Salesforce and other programming languages. So you can follow my channel to watch these videos. So now coming onto the topic. So right now I'm going to fail a flow knowingly. So in my previous video, I demonstrated you how we can create opportunity with the help of screen flow. So let me open these screens again and go through with this. So this screen is related to opportunity name and closed date. So for opportunity name, you can see this red S-risk is available because it is required and closed date is not having required. So in my previous video it was required, but now I unchecked it. So it is not required. You can leave it blank as well. Then if you go to second screen. So whenever you want to open the screen, you need to double click on that. And that screen will be open or you can say that element will be open. And here you can see first stage S-risk is also available. So two components are required and one is optional. And third element is for creating record. So this will create opportunity record. So here we are filling these information name, closed date and stage name. So now if you have modified something in the flow before executing it, you need to click on save. If you are using your flow on any component, then you need to activate it. Right now we are not using flow on any component. So we are not activating it. We are just clicking on debug. I clicked on debug. So from here you need to click on run. Here you can see the opportunity name is required. So we need to pass this to test opportunity from flow for error. Now we need to fill closed date, but right now I'm not filling it. And if we move to opportunity and if we try to create new opportunity. So here you will see whenever we want to create opportunity record, we need to fill opportunity name, closed date and stage. So closed date is required field, but I'm not putting any value in that. I'm leaving it as blank. Clicking on next. So you will see on right inside all debug information is available. So opportunity name is available, but date is blank. Now I'm selecting stage as let's say need analysis. And I'm clicking on next. So here you can see error occurred. And this error occurred when the flow tried to create records. Required field missing. So this is the required fields are missing. So it is showing which field is missing that is closed date. You can look up. Exception code values in the SOAP API developer. Right. So apart from this error, it also throws an email to the user who last modified the flow. So here you can see the mail is available and it is showing all the details. All screen inputs, all components values it is showing. So it is showing flow API name name is this flow type is screen flow type is one status is inactive or name is this, then flow interview detail, create opportunity, data and time, current user username and record ID, start time, duration, then how the interview started. So all these information are available then screen details. So screen one is having opportunity name, but it is not having close date because we knowingly didn't mention that then screen two is having stays as need analysis. Then it tried to create record. So close date you can see it is null name is this and stays name is needs analysis then result is free to create record and error occurred. So this is the error which is shown here. So this way the thing that I told you in the starting like what happens when flow fails. So it throws an email and how to analyze through an email. So I demonstrated you how you can analyze this email. So remember that whenever flow fails, it throws an email and mail will be sent to the person who last modified the flow. So through that you can analyze what errors occurred. So right now we debugged it. Let's say if we didn't debug it and we directly executed this flow. Let's say from record detail base. So this error won't be coming there. Right. Then you will be dependent on this email. So if you have this email, you can easily debug your flow like what error was there so that you can identify each steps are available here. So you need to identify the errors for that purpose. You need this email. So friends remember that whenever flow fails, an email is triggered and you can analyze what errors and what step you executed so that you can debug the flow and you can correct it. So this is all about these two things in this video. I hope you understood whatever I demonstrated. If you want to watch more Salesforce training videos, you can search my name Sanjay Gupta on YouTube and you can watch various playlists related to various programming languages. Thank you for watching this video.