 Hello friends. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to demonstrate how we can create lookup in screen flow. So to create lookup in screen flow, I'm going to use record choice set. Then I am going to apply filter conditions as well so that we can filter certain records by picking up the records in that lookup. And for example, I'm going to create a contact and that will be associated with an account, right? So through that lookup, we will be associating contact with a particular account that you can select from the list. So 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. Here you can find various playlists related to Salesforce and other programming languages. So now coming onto the topic. So I'm going to create new flow so you can search this flow page from this quick find. So just type flow here and you can click on this flow link. So this page will be open click on new flow. So a new tab will be available. So from here, you need to click on screen flow because we are going to interact with the user. So right now I'm going to create first screen. So screen, we need to provide the label for screen. So its label is get contact details. API name is populated automatically. If you want to put any description you can do as well. Then other things are available. So configuration, a frame, if you want to show header footer, so this is header and this is footer. If you want them, check these sub-boxes as well, otherwise set them as false. Control navigations and pause messages then help. So as per your requirement, you can fill these details. Now, from left side, I'm putting a screen component. So I'm choosing text. So if you have created contact, so you might remember that last name is required in case of contact creation. So this text label is last name. It should be required. So it is available on the screen. I'm clicking on done. So this way I created the screen. So this screen will be receiving last name now to create lookup. First I need to go to manager and clicking on new resource and from here I am choosing record choice set. So you need to create record choice set to create a lookup kind of thing in the screen flow. So API name is accounts. Object will be account because we are going to filter account records. Right now I'm not providing any condition. So I'm choosing get on account records, no condition. And then later on I will show you how you can set the condition so that you can filter the records. And choice label, I want to show account name, data type, text and whenever I will be choosing any account, so its ID will be passed automatically, right? And that ID we can use to assign while creating the contact. So if you other than ID, if you want to patch any other field related to account record, so you can put that field here and you can create a flow variable so that they can be used. So right now we are not going to use any other field other than ID. So I'm clicking on done. So this way I created record choice set. Now I can use that in this screen. So from left hand side I am searching for pick list. I'm dragging and dropping it. So this pick list label will be select account. And it's data type text, default value, no. Now select choices. So your record choice set will be available here. You can choose it. And these are other options. So I'm not going to touch those options. So I'm clicking on done. So this way our screen is created, right? Now I'm going to pick one more element that is create record. So its label will be create contact. How many records to create only one use values from a record? No. We have separate variables. So I'm choosing second option. And we are going to create contact records. So I'm choosing this option. Now here we need to set the fields. So last name is required. So I'm choosing that field. And we have one variable named as last name. So we can map that. So right hand side is containing flow variable and its value will be assigned to the field that that is available on the content. So while contact record is creating this will be assigned. Now I'm going to add one more field that is account ID that I can fetch from this accounts record. So the accounts report choice set. So it will assign automatically whichever account I'm going to select. Clicking on done and connecting this. Now I have to save this. So the account is label. Clicking on save. So this is saved. Now we have this button debug. So I'm not putting this screen flow on any quick action button or any record page. I'm just debugging it from here. If you want to test it with record page or any other tool. So you can watch related video like how you can play screen on record page or production or any other tool. So that will help you be just going to test how lookup works. So I'm just clicking on debug. So the flow execution will be opened in a new tab. So there you will see two options. So here you can see input variables are not required. So it is not asking anything. It is asking for executing this flow. So I'm clicking on run. So at left hand side you can see two options are available last name and all accounts. So all available accounts in your org are displayed here. And we don't have any filter criteria. That's why all accounts records are listed here and their names are listed because we choose names to be displayed. So let me create one of one contact. So last name. Let's see. And account I'm selecting as United Oil and Gas UK. Right. And then capitalizing it and clicking on next. So right hand side, you will see it will be creating a record. So these values we received. So from choice, this is the account ID, which is passed automatically, then record is created account is assigned. The last name is assigned. And this is the contact ID that record is created. So I'm copying it. Moving here and I'm pasting it here so that you can test whether this account record is created or not and whether it is linked to the particular account which we selected. So here you can see in details. Last name. We provided only so it is combination of first name and last name so it is showing only an account name is this United Oil and Gas UK. So it is linked automatic. Right. So you might have feel a felt like how that look up work. So this is because of this record choice set that we put here. So now I'm going to modify that. So all the resources and elements that you create are available at left hand side. So we need to modify record choice set. So here it is. So here I am going to apply the filter criteria. As we apply and look for filters. So here I'm choosing this field active equals to let's say true. So this field is available on account record if its value is true, then only those records will be filter automatically. I'm saving it. Again, I'm clicking on debug. So this way you will see less number of records will be available in that look up. So, so here you can fill last name and here you can see very less number of records are available because only on these records that active field is having value as true. So this way you can apply filter as well by getting the records from a particular object and with the help of record choice that you can create a look up kind of thing in the case of screen flow. So I hope you understood how we can create record choice set so that we can select a particular record from a list and it is similar to look up that we have on record pages to select a particular record that we want. And I hope you understood whatever I demonstrated in this video. If you want to watch more Salesforce training video you can search my name Sanjay Gupta on YouTube, and you can follow various playlist related to Salesforce and other programming languages. Thank you for watching this video.