 Hello friends. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to demonstrate how you can call lightning screen flow through lightning or a component in Salesforce. And further, I will be placing the lightning component on record page and also we can call lightning component through quick action. So I will be demonstrating both. So first, let me explain how we can call lightning flow in lightning or a component. So this is a simple component where I have implemented a flexi page available for record home interface force column as record ID and force column lightning protection. So this first is because we want to place this lightning component on record page. Then second is because we want to fetch the record ID into record ID variable. And third is because we want to call this lightning component through protection. Then here you can see or a handler in it is mentioned. So it is calling init method and here lightning flow and its ID is flow data. Now we need to move to its controller. So in controller you can see init method is defined and here component is received. So through component, I am fetching flow data. So component.find so it is finding flow data, which is the aura ID of this lightning flow. Then it will be stored in this variable flow. Then here I am creating input variable that will be passed into lightning flow. So name of variable is record ID type string and value will be component.get v.record ID. So here in case of lightning record ID variable is created automatically and we can fetch it to this component.get v.record ID. So current record ID will be stored in this value variable. So now we can pass this input variables into flow. So here I have used this flow variable. So through this I am calling flow dot start flow and this is the API of the flow that we want to bind with this lightning component and this is the input for that flow. So this input will be passed and accordingly that screen flow will be executed. Now this is the screen flow. So here in this first screen I have placed opportunity name and stage and on second screen I have placed close data amount and all these information will be used here. So the input that we are passing through lightning component will be received into this record ID variable in this lightning flow. Then amount closed data opportunity name and stage will be stored in corresponding fields. So this way opportunity record will be created and its ID will be stored into opportunity ID variable. So if you want to use this ID of this newly created opportunity further then you can use this as well. So this way this is the screen flow. This screen flow is called in this lightning component and from here I use the API name. So here you can see this is the API name that I am using. So this way both are connected. Now I need to call this lightning component. First I am placing this on record page. Then I will be launching this lightning component through location. So I will download both. So first I am on this account record. I am going to edit this. So here from here I am going to, sorry, I am going to use this lightning component. So I am dragging and dropping it here. So this is the lightning component that I am using on record page. So it is placed. Now I am clicking on save. Changes are saved. Now clicking on back. So here you can see this is available. So here flow screens are available. So let's say I am passing test. Components, stages, prospecting, clicking on next, filling close date, amount, let's say 3456 and clicking on next. So opportunity record will be created and it will be available here. So I am refreshing it. So opportunity will be linked with this account automatically because we are passing current record ID into flow through lightning component. So here you can see test opportunity through component is created and it is automatically linked with this account. So this way I use the lightning component on the record page and that lightning component is internally calling that lightning flow. So this way this first part is completed. Now I am going to demo you how you can call that lightning component through protection. So for that you need to go to setup, object manager, choose account and go to button links and actions. So here you can click on new action then choose lightning component. So your lightning component will be available automatically here because we are using this interface lightning quick action. So that's why it is available. Now label will be this create opportunity API is populated automatically. So I am clicking on save. So here you can see this. This is created. Now I need to place this action on the page layout so that it will be available. So I'm clicking on page layout. I'm opening account layout and on account layout. I'm going to place this quick action. So you need to click on this mobile and lightning action. So here Salesforce mobile and lightning experience actions are available and create opportunities. So I'm going to place it and clicking on save. So it is saved. So here you can see create opportunity option is not available. So now I'm going to refresh this. So a quick action button will be available here and once I click on that button, so it will be launching the lightning component which will internally call the lightning flow. So I'm clicking on the button. So here you can see pop up is open and your lightning flu screens are displayed through lightning component. So test opportunity through action. Clicking on next fill in date amount 1234 again clicking on next. So it is completed. Now I'm closing this refreshing the page. So here you can see total five opportunities are available so test opportunity through action is created. So this way I hope you understood how we can call lightning screen flow in lightning component. So first you need to create lightning screen flow. Then you can create your lightning component with the help of this code. And if you want to pass parameter you can do you can add more parameters in this as well. And then there are two options either use your lightning component on record page or you can call your lightning component through protection and internally that lightning component will be executing your screen. So this way I hope you understood how we can call lightning screen flow through lightning or a component in Salesforce. If you want to watch more Salesforce training videos you can go to description of this video. There you will find various links of playlist related to Salesforce videos. So follow them. Thank you for watching this video.