 Hello, everyone. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to demonstrate a use case related to screen flow. So let's understand the requirement of screen flow first, then I will be demonstrating how you can implement it. So the requirement is upon case creation, assign a task to related account owner. So we will be implementing this through two ways. So in flow, you have a action through that you can create a task and another way is to use a create record element. So let me show you like how does task look like. So if I go to any account record. So here under activity, you can see here we can create a task, right? So if you want to create a task, so you need to fill subject due date name related to assigned to status fields. And if you save it, so task will be created. But now this task will be created automatically with the help of screen flow. So I will be creating a flow through that a case will be created on account and a task will be created under account so that account owner can follow up on that task. So I'm going to create new flow. So flow will be of type screen flow. Now here, first of all, I need to create a screen. So basically, we need to identify what are the required fields so that we can receive those from user through the screen. So here you can see we have status and case or isn't pick list as required. So here I'm going to create a screen. So this screen will be receiving case information. And here I'm going to use a pick list. So its label will be status. It is required. And from here I need to link this pick list with the status pick list that is available on the case object. The API name is case status case, or it should be case status. Then object is case data type is pick list and field I'm selecting status. Now I'm clicking on done, having one more pick list. So second pick list should be case origin. So labeling it as case origin required. Then again I'm selecting new choice resource as pick list. So API name is case or isn't object I'm selecting case data type is pick list, and here case or isn't and done. Okay, the screen is ready to receive status and case origin for the case that we want to create. Now, I need to create one resource as variable, and API name will be record type so I will be placing this flow on account record page. So from account record page, the account ID will be available on this record ID. For that purpose, you need to enable this checkbox like available for input. So this variable can receive input from outside the flow. Now I'm going to create a record. So we need to create a case. So create case, we need to create one case then use separate resources and literal. Then here we need to use case. Then first we need to map the status field with status pick list. Then we need to map the origin. So at left hand side, these are case fields. And at right hand side, the case, sorry, screen components that we created as pick list that I'm selecting. So fill in your case with account. So on case we have account ID look up. So we need to fill it with record ID. Now after creation of case, if you want to have the newly created case ID, so you need to enable this checkbox and you can store that case ID in a variable. So I'm creating a variable as of like case ID data type is text and done. This way through this element case will be created. Now, after creation of case, I need to assign a task to account owner. Right. So I need to receive the information of account owner. So what I'm going to do. I'm going to use a get record element. So get account details. Here I'm selecting account as object. Now here I need to select the ID equals record ID and only the first record and automatically store all fields and done. So this element will be fetching all the account related information, but we just need to use the account owner ID. Now here I'm going to use this action. So as I told you, we have two ways to create tasks. So I'm going to show you first way that is create tasks through action. So I'm selecting this action. And here I'm searching for task. So at bottom you can see we have a quick action task. So I am selecting it. Now here create task. Then assign to ID. So we need to assign it to account owner. So that account and here we have owner ID. So I'm searching for that. Right. So this will this task will be assigned to the owner of the account. Then we need to fill the due date. So, so here I'm going to create new resource as a variable. So here I'm setting MMDD YY. So for example, six slash three slash two zero double two and done. Right. So due date is set here. Then we need to fill the name ID record ID related to ID. So let's see like if you search object manager and task object. So here you will be having all these things. So we need to see name ID. So here if you scroll. Okay, name ID is not available here. Related record ID. Yeah. So this will be okay. Related record ID will be your account. So we can write record ID. Right. So related record ID. So if if I see here related to and related to ID. Okay, let's go there on the UI so that we can identify it clearly. So if you go here and create new tasks. So here you can see related to means account and assigned to. So actually we need to fill related to an assigned to. So assigned to what we already filled and related record ID is already set. Then we can set the status. So status like not started in progress. Let me search. Okay, so right now I'm not selecting any status instead I'm putting a subject. So I'm creating a resource data type text and here default value I'm setting as follow up tasks. So this will be used here and I'm clicking on done. So this way I use this create task action. So I just filled assigned to due date related record ID and on. So now I'm going to save it. So flow is like create a task upon case creation. I'm saving it clicking on activate moving to account record page, and I'm going to edit the account page. So I'm just removing this flow from here dragging and dropping it. And from here I'm going to select create a task upon case creation saving it moving back. So here you can see this flow is available so I'm just selecting some values. You can see there is no task on this account so I'm clicking on next. Okay and unhandled error. So basically, there is some error so let's check the email so that we can identify the error. So it is saying missing required input parameter owner ID. So, Okay, so basically what I forgot like I just didn't enable that checkbox while I place the flow on the record page. So I just need to enable this checkbox so that the record ID of the account should be passed inside the flow. So I just saved it again moving back. So I'm going to create a case. So this time it is created here you can see the cases available. Now, if I go to account. Okay, so if I go here so under activity you can see a follow up task is also created. So if I open this so it is assigned to the account owner. So if we go to account so account owner is Sanjay Gupta. So here you can see if I open the follow up task. So if I go to Sanjay Gupta for subject is follow up task due date is there. Priorities normal. It is populated by default status is not started by default, then like it is related to account. Right. So this way, like if you want to create a follow up task on particular record so you can do. So basically, in this demonstration I created this follow up task on account to assign it to account owner. If you want to create this task on case. So that is also possible. So in that case what you need to do instead of passing this record ID here you can pass the case ID, which we received after the case creation. So this is also possible. Right. So this way, like, when I when we created this element so we use this case ID so you will be able to use that. And in that case if you go to your case, like if you open any case so on cases also in the related list you will see not in the list. So here activity component is not available. So basically we need to add tasks and events here so that those will be used so how you can do that. You just need to add it to the page. And here is the activity component. So you can directly drag and drop it. Okay, so basically, what we can do. We can have a tab here, named as activity done. Now under this activities we can place it. Then you can move back. Now on case you can see this activity is available. Right. So if you create anything so that will be available here related to task and event. Right. So now I'm going to update the flow. So we have one more way like how to create tasks through record element. So I'm just going to remove this. And I'm going to have this create record element. So here I'm labeling it as create task one you separate resources so object will be task. So here we need to fill all the required fields right so we need to fill assigned to so assigned to will be get account dot owner ID, then due date. We created a date variable so I am. No, yeah, do it only then. Next we need to set related to. So here I'm setting record ID so it will be related to account, then we need to populate subject so we created a variable subject so this way it will be populated. So if you're setting all these information owner ID due date what ID and subject, you just need to click on done save as save and activate. So the flow is already available on account so I'm moving to account record. This time I'm opening a separate account where cases not available, and there is no task created. So I'm going to create new case. So you can see cases created and here you can see follow up task is also created. Right, so this way I showed you two different ways to create a task upon case creation on account. First is through action and second way is to through create record.