 Hello everyone. I am 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 says we need to create a contact with optional file attachment. And this I need to implement with the help of flow. And after creation of the flow, I need to place the screen flow on either home page or app page. So I will be placing the flow on both the pages. So let's first jump to developer org and let's create this screen flow. So I'm just going to search for flows, creating new flow. So from this list, you need to select the screen flow, then click on create. Now I'm going to create one screen where I will be receiving inputs related to contact. So I just clicked on plus then I am selecting the screen. The label off screen will be contact information. Now from here I'm just picking this text. So it will be receiving the first name. Then one more text. It will be receiving last name and I'm making it required because to create a contact record, you need to have last name populated on the contact record. So that's why I'm making it required. Then to receive phone. I'm just using phone field. Or you can say phone component. So here I'm writing it as phone. And again, I'm using text so that I can receive email. And then I'm using a checkbox. So this checkbox I will be using to ask. Do you want to attach a file? So this is the label. So if this checkbox is checked, then only that file upload screen will be available. Otherwise not. So this way I created the screen where these options are available. Now I'm clicking on done after the screen. I just need to create a contact, right? So for that, I'm going to use this element. Contact. Now use separate resources and literal values and how many records to create one. So from here I'm going to select the contact. Now I just need to map all the fields. So on contact, whatever fields available, they are available here at left hand side and the on the screen, whatever components you have created, they will be available at right inside. So here I'm searching first name so you can see it is a screen component, then adding one more field that is last name. So I'm searching last name here as well. Then I need to match phone. So I'm matching it with mobile phone. So phone dot value. If you create it as a text, so you can directly use it, but we created a phone component. So that's why we are using phone dot value. And then email. So here we need to search for email, right, and enable this checkbox so that after creation of this contact record, you can store that contact record ID in a variable. So click on new resource, create a variable, name it as contact ID and done. Sorry, you need to select the data type as well. I'm selecting text and done. So this I will be using on the screen where I will be attaching the file. So this way these two elements are available here. Now, based on this checkbox, I just need to check whether it is enabled or not like user checked or unchecked. So I just need to apply. Sorry, I need to apply decision element here. So if it is checked. I need to check this. So if it is equals true. So this is one outcome. I'm having one more outcome that is unchecked. So do you want to attach a file equals. No, right. So if it is checked, so it will be true if it is unchecked, then it will be false. So this way I created two outcomes. Now here I'm going to implement the further elements. So if it is checked, it means we need to upload a file. So here I'm going to use a screen and I'm searching for file upload. Okay, so API name should be this. This will be the label upload a file which will display here you can see. And if you want to link this file with the contact, so you need to put contact ID here in the related record ID. So the contact that you created in the previous screen and element so that ID will be mapped with this newly attached file automatically. So we need to provide the label so file upload screen. And I'm clicking on done and if it is unchecked. So let me just end this right. So if it is checked or unchecked, right. So, like file upload checkbox is checked then file will be uploaded if that is unchecked then we will come here. So I just want to have one common screen like I want to show a thank masses like your contact is created and thank you for providing your information like that. This is thank you screen and here I am searching for display text and dragging and dropping it display masses. Thank you for providing your information contact record is created successfully right this message will display and I'm clicking on that right so this is common message if you upload file so it will go to upload file and then come here. So if file is file upload is not required then it will come here and this masses will be displayed. So this way I implemented this flow. Now I'm going to save it. Save. Now I'm going to activate it. So moving to the user interface so let me just open any application. I'm just going to open sales application. So now here you can see we have a homepage so first of all I'm going to place it on the homepage so I'm going to edit the page and at left hand side you can see we have a flow or if you don't find you can search it will be available you can drag and drop it. Now from the list you need to select the flow. So I'm selecting create contact with or without file right and clicking on save. It is asking for activation. So I'm going to activate it for a sign as of default clicking on save. Moving back. So on homepage you can see this is your flow. So it is asking for a name. So let's say I'm providing Sanjay Gupta phone number. I'm providing dummy phone number. So let's say this one email ID. So this is my email ID I'm providing so right now I'm checking this checkbox and clicking on next. So you will see upload file option will be available. So if I click on this. And if I upload any file and click on done. Next. So you can see this thank you message is available now I'm clicking on finish. Right. Now if I move to contacts. So here you can see it is created right now. And if you want to make sure. So here you can see file is also attached. Right. So this way. I demonstrated you how we can place your flow on the homepage. Now if you have any app page so they're also in the similar way you can place your flow. So I'm going to do that and in that app page I won't be selecting this checkbox and you will see without asking for file upload or contact will be created. Okay, so let me just search for the pages so I'm searching for lightning app builder and let me see whether we have any app page or not so we don't have any app page. So I'm going to create new app page. So you can select this option click on next. So demo app page clicking on next. So you can choose any option from this then click on finish. So your page will be created and simply drag and drop your flow. Select the name of the flow that you want to show and save. It will ask for activation. So you just need to select the application. So I'm selecting sales application. So after home page this page will be available. So I'm just clicking on save and moving back. Now going to the application and doing a refresh. So here you can see demo app pages available if I click on this. So here you can see the complete flow is available. So this time I'm creating one more contact and this time I'm leaving it as as is unchecked and clicking on next. So you can see without asking file upload it is showing the thank you masses and I'm clicking on finish. So here you can see this contact is available. And if we go to related list so there is no file uploaded. So this way you can implement your flow through which you can upload a file just after record creation and I just demonstrated you like how you can place your flow on home page and app page. Real time projects. Sometimes it is required like instead of placing your flow on record page you need to place your flow on app page or homepage.