 Hello, everyone. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to demonstrate a scenario based on screen flow. Let's understand the screen flow scenario. So the scenario is we need to create any one of the following record related to account based on users choice. So we need to create a screen flow where these three options will be available as a choice. So if user selects contact, so a related contact will be available under account. If user selects opportunity, then opportunity record will be there. If user selects case, then case. So now I'm going to demonstrate you like how in a single flow, we can implement this scenario. So I just searched flow in the setup now clicking on new flow. So I'm going to implement this flow from the beginning so that you can follow. So I'm just selecting screen flow, clicking on create. Now, first of all, what I need to do, I need to create a screen where I need to show contact opportunity and case as an option. So selecting a screen, labeling it as object selection. Now here I'm going to have a pick list. So this is a single select pick list and labeling it as select an object. Then it is required. Now, here I need to provide the choices. So we don't have any pre implemented choices pre configured choices. Right. So we need to create choices manually. So for that you just need to create this choice. Now here API name you can provide as contact then choice label that will be available at the label of that pick list. So that will be choice. And if you say that will be contact and if you select that contact label. So what value you want to use corresponding to that contact as a value. You can just place contact here. So in simple words, we can say like API name, label and value can be same data type is text and just click on done. So this way first choice is contact is created. I'm going to add one more choice. So here choice then opportunity so I'm copying and pasting it as label and value clicking on done. Similarly, again I'm clicking on new choice resource from here choice and this time I am writing case, providing case as label and value and clicking on done. Right. So this way my this single selection pick list is created. Now I'm clicking on done. So after this like user will be selecting any one option. So I need to decide which object user selected. So, whenever we have more than one options and we need to select any one or we need to decide. So for that purpose, you can just select a decision element. So, labeling it as check selected object. So here I'm writing is contact. Now, I need to have the pick list where all the options are available so pick list API is selected object, if it is equals to contact. So it will be one outcome. Then you can say like is opportunity. So select an object. So you need to select this pick list equals opportunity then again plus is case then select an object equals case. Right. So this way these three outcomes are available and one is the default outcome. So if I click on done. So you will see four outcomes are available here. Now we need to do separate implementation for each of the outcome. So what I'm going to do. I'm just going to separate them out. So just click on plus and click on. And so this way, you will be having these four flows. Right flow lines. So here you will be creating contact here you will be creating opportunity and then case. This is the default outcome. Right. So let's first create a contact. So you need to click on plus then you need to have a screen. So here I am labeling it as contact information. I need to search for text. So I'm just placing it. I'm just labeling it as first name. Then having one more text. And it will be last name and I'm making it required because on contact last name is a required field. Now I'm clicking on done. So this way my contact screen is created. Now I need to create a record contact record. Create contact how many records to create one how to set the record fields. So I am using separate resources and literal values. Then I'm selecting contact. So I need to map first name with the first name screen component value. Then I need to map last name with the last name screen component value. Now one more thing I need to do so as of now I'm just clicking on done. So one more thing I need to do like I need to place this flow on the account record page. So this contact opportunity and case should be related to that account. So I need to have account record ID. So I need to create a new resource as a variable and its API name should be record ID. However, through screen flow if you want to fetch the record ID, you need to create the variable named as record ID. Here I is capital and everything is a small and it's data type will be text. Then you need to enable this checkbox that is available for input because this variable will be receiving value outside the flow. Then done now open this element again and here like on contact we have a lookup that is account ID. So we need to populate this record ID into this account ID lookup. And you need to click on done. So this way this first part is complete. Now we need to create opportunity. So let's have a screen. So naming it as opportunity information. Now, first I need to have opportunity name. So required. Then I'm having dates so it will be closed it. So an opportunity, opportunity name, closed it and stays. These are required fields. So that's why I'm creating these three. So this is stays name it is also required. Now here what I need to do. I'm creating new choice resource and I need to link stays field that is available under opportunity object with this pick list. So I'm creating pick list choice set. So, so it is opportunity object data type pick list and then selecting stays name then clicking on done so it will be linked automatically now again I'm clicking on done. Now to create opportunity I need to have this create record element. So create opportunity. Then select this use separate resources and literal values and one record we need to create. Now here, you can select opportunity. We can map opportunity name with name so here smartly you need to select like first name last name I use for contact and name I use for opportunity. So I'm mapping that. Then close date and stage. So if you type stays so here we have two things so you just need to select this screen component because on screen component you will be actually selecting a particular stage. And if you want to link this opportunity. So you need to have this account ID and record ID. And click on done. Now next is case. So let's check what all fields required on case so if I open case tab and click on new. So here you can see status and case or isn't these are required. So now I'm going to create a screen labeling it as case information then pick list. So we need to have status first. So labeling it as status required, and we need to link it with the pick list that is already available on case objects. So again, I'm selecting pick list choice set, naming it as case status. Okay, and one more pick list I need to create that is case origin. So labeling it as case origin require and here new choice resource and I'm selecting pick list choice set is origin then selecting case data type pick list. So case origin and done. So this way the screen will be receiving two information now again I need to use create record element so that one case record will be created. So create case. Same options one and you separate resources. Then from here I'm selecting case. So we need to map status and then we need to map origin. And on case we have account ID look up so we need to store record ID. Right. So this way it is implemented. Now, I'm just clicking on done so you can see like this flow is completely implemented. Right. Now what we need to do. We can just save it eight case or contact or opportunity and save. Right. And now I'm activating this. So I'm just jumping to sales application opening accounts tab. Opening account record. So here you can see two flows are already available. So now I'm going to add it the page. So I'm just dragging and dropping this flow component so I just drag and drop it on the top like first. And here I'm going to select this flow create case or contact or opportunity and just enable this chat box so that the current account record ID will be passed to the flow. Save it. Go back. So your flow will be available and you will see these options create like you can create contact opportunity and case. So on this record you can see we have one contact one opportunity and one case. Now I'm going to create each record one by one. So first time creating contact and next. So you can see contact is created now opportunity. OPP one oh one then close date and then stays named and next. So you can see opportunities also created. Similarly, if you want to create a case. So from here you just need to select the values and just click on next. So you can see cases also created. So this way I demonstrated you like how through a single flow you can have a selection and through selection how you can create different different records for different objects and those are related to account record.